I have an issue with the following page : http://gpsactivitymanager.com/events/5dfa8a46-57f1-45e1-9f11-f9ee6523c31a/# The page has a succession of AJAX style calls in it to selectively replaces the content of DIVS. Load the page and then click the "splits" option from the menu bar (top left). For the table that appear on the left hand side click one of the information bubbles - a javascript error occurs saying it can not find the ''splitInfo'' function. This javascript function is part of the html inserted when the table is requested. The AJAX call is performed with code like this : new Ajax.Request(''selContainer'', ''/htmlblock.php?id=12345 ?>'', { method: ''get'', evalScripts:true, onComplete: hideActivity }); I thought the ''evalScripts'' parameter ensured that any JavaScript in the returned HTML was evaluated, but that does not appear to be the case here. Anyone point me in the right direction...? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Dec 20, 2007 11:29 AM, bbbs <bbbs.bbbs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > For the table that appear on the left hand side click one of the > information bubbles - a javascript error occurs saying it can not find > the ''splitInfo'' function. This javascript function is part of the html > inserted when the table is requested. > > The AJAX call is performed with code like this : > > new Ajax.Request(''selContainer'', ''/htmlblock.php?id=12345 ?>'', > { > method: ''get'', evalScripts:true, > onComplete: hideActivity > }); > > I thought the ''evalScripts'' parameter ensured that any JavaScript in > the returned HTML was evaluated, but that does not appear to be the > case here.Check the documentation at <http://prototypejs.org/api/ajax/updater>; it describes how to declare functions in external files if you want them to work with Ajax requests. Basically, you''ve got to be rather particular with how you declare functions. Make sure you''re doing THIS: splitInfo = function() { // contents } ... instead of this ... function splitInfo() { // contents } Hope that helps. :Dan Dorman --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Dan - works perfectly now !. On Dec 20, 7:14 pm, "Dan Dorman" <dan.dor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Dec 20, 2007 11:29 AM, bbbs <bbbs.b...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > For the table that appear on the left hand side click one of the > > information bubbles - a javascript error occurs saying it can not find > > the ''splitInfo'' function. This javascript function is part of the html > > inserted when the table is requested. > > > The AJAX call is performed with code like this : > > > new Ajax.Request(''selContainer'', ''/htmlblock.php?id=12345 ?>'', > > { > > method: ''get'', evalScripts:true, > > onComplete: hideActivity > > }); > > > I thought the ''evalScripts'' parameter ensured that any JavaScript in > > the returned HTML was evaluated, but that does not appear to be the > > case here. > > Check the documentation at <http://prototypejs.org/api/ajax/updater>; > it describes how to declare functions in external files if you want > them to work with Ajax requests. > > Basically, you''ve got to be rather particular with how you declare > functions. Make sure you''re doing THIS: > > splitInfo = function() { > // contents > > } > > ... instead of this ... > > function splitInfo() { > // contents > > } > > Hope that helps. > > :Dan Dorman--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---