I register ajax listeners in my application.js in the dom:loaded function. In some of my views I also need to use the dom:loaded event to do other javascript stuff. Since I already have my dom:loaded in application.js, can I specify another dom:loaded in the script tag in my view or is there a better way to do it? I know this could be a prototype question, but since this is rails, I thought someone might have tried this already. Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
badnaam wrote:> I register ajax listeners in my application.js in the dom:loaded > function. In some of my views I also need to use the dom:loaded event > to do other javascript stuff. Since I already have my dom:loaded in > application.js, can I specify another dom:loaded in the script tag in > my view or is there a better way to do it? > > I know this could be a prototype question, but since this is rails, I > thought someone might have tried this already.http://guides.rubyonrails.org/layouts_and_rendering.html#using-content-for Specifically this part: --- The content_for method is very helpful when your layout contains distinct regions such as sidebars and footers that should get their own blocks of content inserted. It’s also useful for inserting tags that load page-specific javascript or css files into the header of an otherwise generic layout. --- -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.