On 1 Mar, 10:54, "yoshi" <[EMAIL PROTECTED]> wrote:
>
> i m using ajax.updater currently, my ajax response returns only script
> text, contianing the script tag.
> Instead of setting 'evalScript: true' in the method, i set

If U have only JavaScript code in the response it will be better if
you don't send it as a html but as a text/javascript or using X-JSON
http header wich prototype will evaluate automatically.
Read here more:
http://www.prototypejs.org/learn/introduction-to-ajax
search for: "Evaluating a JavaScript response".

> onComplete: function(response) {
>   //some element already loaded that i know is on the page
>
>   var scriptTag = document.createElment('script');
>   scriptTag.type = 'text/javascript';
>   scriptTag.text = response.responseText;
>
>   $('bodyContent').appendChild( scriptTag );
>  }
>
> i think appendChild is the same as doing an eval() right guys?
>
> of course the above did not work, but theoritically it should right?

I''m not sure...
But in Your case I would do:

onComplete: function(response) {
  eval(response.responseText);
}

Nothing more :-)

Greetings

DK


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to