On 7 Nov 2008, at 17:18, Xin Zheng wrote:
>
> Hi guys,
>
> I am trying to display Javascript code after an Ajax call. It is
> executing the JS code, but it''s also displaying it. It shows as:
>
> try {
> alert(...);
> } catch ..
> ...
>
> my controller code:
>
> render :update do |page|
> page.alert message_var
> end
>
> my Javascript code:
> new Ajax.Updater("div_id", my_controller_url,
> { asynchronous: true,
> evalScripts: true,
> method: ''get'',
> parameters: query_string
> }
> );
>
> In the prototype documentation, it says AJax.Updater''s evalScripts
> will
> eval anything in <script> tags, and they will not be displayed. Is
> there
> anyway to wrap RJS output''s in <script> tags?
>
Don''t use Ajax.Updater with render :update (just plain old
Ajax.Request will do fine)
Fred> Or another way of solving this?
>
> Much thanks
> Xin
> --
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---