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 2009-05-11 11:01
on 2009-05-11 12:43
on 2009-05-11 12:50
Hi In my partial I tried like <div id"graph_div" onload="somescript();"> </div> But this onload not working Since I tried with an alert first Could you please tell how can I do this? Sijo
on 2009-05-12 15:26
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.