yields this godawful mess (the ‘activate_tab’ method is in the
ApplicationHelper, but all the javascript is being escaped regardless of
where it’s generated):
"current";\n$("section").hide();\n$("section").visualEffect("Appear",
"{queue: ‘end’}");’); throw e }}}); return
false;">Contacts
I looked through the docs and even scanned the code a bit, but I can’t
figure out where escape_javascript is being called or how to prevent it
from being called.
I looked through the docs and even scanned the code a bit, but I can’t
figure out where escape_javascript is being called or how to prevent it
from being called.
Any help would be greatly appreciated.
Thanks much,
-Mike.
Try removing the :update parameter from your link_to_remote call, see if
that has any effect.
I think the :complete takes a javascript function name, rather than
the whole function.
Alan
e.g. :complete => “undoRequestCompleted(request)” or something.
You might try:
<script type = “text/javascript>
function mycomplete()
{
<%= update_page do |page|
page.activate_tab(”#{menu_item}tab", 'menu’)
page[‘section’].hide
page[‘section’].visual_effect(‘Appear’, ‘{queue: ‘end’}’)
end %>
}
to use rjs to generate the javascript into a regular function, which you
then pass to complete
Wow! You guys are right. It’s been escaping my manual javascript the
whole time and I didn’t even notice it, because it worked! And who would
have though such badly mangled code would work… The only thing busted
is effects queues
Guess I have to restructure a couple of things in my app unless somebody
can figure out how to make it stop doing that. There really should be a
way…
Thanks for all the help.
I think the :complete takes a javascript function name, rather than
the whole function.
Alan
e.g. :complete => “undoRequestCompleted(request)” or something.
You might try:
<script type = “text/javascript>
function mycomplete()
{
<%= update_page do |page|
page.activate_tab(”#{menu_item}tab", 'menu’)
page[‘section’].hide
page[‘section’].visual_effect(‘Appear’, ‘{queue: ‘end’}’)
end %>
}
to use rjs to generate the javascript into a regular function, which you
then pass to complete
Alan
and using :complete => “mycomplete”
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.