marco.rizzetto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Dec-14 14:11 UTC
Prototype and Javascript
Hi I''m newbie with prototype. I have this question. I use the Ajax function (Ajax.Updater with evalScripts:true) to load a view in a div. Now in this view I would load an external javascript file and use it inside the view. But when I use a function defined inside the javascript file I get an error : "the function is not defined" Can anyone help me? Many Thanks Marco --~--~---------~--~----~------------~-------~--~----~ 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 14, 2007 7:11 AM, marco.rizzetto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <marco.rizzetto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I use the Ajax function (Ajax.Updater with evalScripts:true) to load > a view in a div. > Now in this view I would load an external javascript file and use it > inside the view. > But when I use a function defined inside the javascript file I get an > error : "the function is not defined"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.Updater. In a nutshell, though, you want to do this... coolFunc = function() { // contents } ... instead of this ... function coolFunc() { // 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 -~----------~----~----~----~------~----~------~--~---
marco.rizzetto-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Dec-19 07:55 UTC
Re: Prototype and Javascript
On 14 Dic, 15:11, "marco.rizze...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <marco.rizze...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi > I''m newbie withprototype. > I have this question. > I use the Ajax function (Ajax.Updater with evalScripts:true) to load > a view in a div. > Now in this view I would load an externaljavascriptfile and use it > inside the view. > But when I use a function defined inside thejavascriptfile I get an > error : "the function is not defined" > Can anyone help me? > Many Thanks > Marco--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---