When I return an html fragment to Ajax.Updater with evalScripts: true set, and there is a script fragment with curly braces in it (a function declaration or an object literal), the curly braces are getting stripped out somehow, and leaving me with invalid JS. I think this is the case because I put an alert in the evalScripts method right before the "return eval(script)" and it had no curlies. Plus, my javascript doesn''t work in the browser as soon as I add curlies (but does work without them). Anyone know what''s going on? --Zac --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-04 12:11 UTC
Re: Ajax.Updater with evalScripts: true strips curly braces
Zac Hansen a écrit :> I think this is the case because I put an alert in the evalScripts > method right before the "return eval(script)" and it had no curlies. > Plus, my javascript doesn''t work in the browser as soon as I add curlies > (but does work without them).There''s nothing in Prototype.ScriptFragment that should cause this. Can you post a minimal reproduction online, for us to tinker with? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Prototype 151; Ajax.Updater vs Ajax.Request and evalScripts=true
- Ajax.Updater evalScripts:true
- BUG in PROTOTYPE when set evalScripts: true - Firefox crashes
- js not executed after ajax.updater -- evalScript:true not a solution
- Ajax.Updater : About evalScripts and defining functions