I have a ajax request that loads me a ruby page in my mainArea div: new Ajax.Request(window, {asynchronous:true, evalScripts:true, onSuccess:function(req){$(''mainArea'').innerHTML=req.responseText}}); where ''window'' is the ruby page In my ruby page i have a javascript function( alert("test"); ) If i access directly the ruby page(window) the function it works but if i load it with ajax didn''t access the javascript. If i put the javascript function in the first page where i make the ajax request it''s work, but i don''t wan''t to. Many thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
adi wrote:> I have a ajax request that loads me a ruby page in my mainArea div: > > new Ajax.Request(window, {asynchronous:true, evalScripts:true, > onSuccess:function(req){$(''mainArea'').innerHTML=req.responseText}}); > > where ''window'' is the ruby page > In my ruby page i have a javascript function( alert("test"); ) > If i access directly the ruby page(window) the function it works but if > i load it with ajax didn''t access the javascript. > If i put the javascript function in the first page where i make the ajax > request it''s work, but i don''t wan''t to. > Many thanksI have found the problem. Is a bug in evalscripts from ajax. thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---