On Jun 7, 2011, at 10:05 PM, elliottg wrote:

I am loading a partial via AJAX in my Rails 3 app. I want to have some
partial related JS loaded when that partial loads so that I am only
loading JS when needed.

No matter what I do, I cannot get the JS <script> elements to render.
I have used variations of the Rails javascript load helpers as well as
straight up <script> tags. No matter what I do when I look at the
markup loaded by AJAX I never see my <script> tags.

I can always load css that's part of the partial just fine, but never
JS.

What's going on here?

Prototype strips out inline scripts unless you set the property evalScripts:true inside your Ajax parameters. In the Rails helper, that's probably done by adding :eval_scripts => true somewhere, give that a try.

Walter


Thanks, Elliott G

--
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- t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .


--
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to