Eric Gross
2006-Jul-26 03:33 UTC
[Rails] Getting Ajax.Updater or page.replace_html to render js?
Hey guys, I, for the life of me, cannot figure out how to get Ajax.Updater or page.repalce_html to render the javascript in a partial. Upon page loading, the partial gets rendered fine. But when called up to render through an AJAX function something goes wrong. Are you guys getting this error??? -- Posted via http://www.ruby-forum.com/.
Ben Lisbakken
2006-Jul-26 05:12 UTC
[Rails] Getting Ajax.Updater or page.replace_html to render js?
can you give some of the code that is screwing up? -Ben Lisbakken On Jul 25, 2006, at 8:30 PM, Eric Gross wrote:> Hey guys, > > I, for the life of me, cannot figure out how to get Ajax.Updater or > page.repalce_html to render the javascript in a partial. Upon page > loading, the partial gets rendered fine. But when called up to render > through an AJAX function something goes wrong. > > Are you guys getting this error??? > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Dr Nic
2006-Jul-26 16:03 UTC
[Rails] Re: Getting Ajax.Updater or page.replace_html to render js?
If you want to send back javascript, don''t use Ajax.Updater, use Ajax.Request instead. -- Posted via http://www.ruby-forum.com/.
Ross Hendry
2006-Jul-26 16:43 UTC
[Rails] Re: Getting Ajax.Updater or page.replace_html to render js?
Eric Gross wrote:> Hey guys, > > I, for the life of me, cannot figure out how to get Ajax.Updater or > page.repalce_html to render the javascript in a partial. Upon page > loading, the partial gets rendered fine. But when called up to render > through an AJAX function something goes wrong. > > Are you guys getting this error??? >Do you mean "alert(''foo'')" will pop up on first load but not when the partial is rerendered? I had this as well when trying to make new divs draggable. There''s an evalScripts option in Ajax.Updater so the call becomes something like : new Ajax.Updater(container, url, {asynchronous: true, evalScripts:true}); HTH Ross -- Posted via http://www.ruby-forum.com/.