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???

can you give some of the code that is screwing up?

-Ben L.

If you want to send back javascript, don’t use Ajax.Updater, use
Ajax.Request instead.

Eric G. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs