Invoke a controller def from view without clicking any link

Hi
I have a controller def like

def graph_render
get_flash_chat_objects
respond_to do |format|
format.js do
render :update do |page|
page[:graph_div].replace_html :partial => “summary_graph”
end
end
end
end

So clearly this just accept an ajax request and do the above action

This is working But what I would like to know how can I invoke it from
view without clicking a link or like that

Thanks in advance
Sijo

On May 11, 8:01 am, Sijo Kg [email protected] wrote:

So clearly this just accept an ajax request and do the above action

This is working But what I would like to know how can I invoke it from
view without clicking a link or like that

Well unless you have a javascript timer on the page that fires off
your ajax request, it’s going to have to happen in response to some
event (not necessarily a mouse click, could be page load, mouseover,
keydown etc…)

Fred

Hi
In my partial I tried like

But this onload not working Since I tried with an alert first Could
you please tell how can I do this?

Sijo

Use prototype functions to handle the onload events. It is better
than plugging in onload code into your HTML tags. Look at the online
documentation for examples. You can use either the dom:loaded event
or the window:onload event.