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
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
I have found the problem.
Is a bug in evalscripts from ajax.
thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.