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

Sorry!
I forgot. According to documentation (the link which I gave U just a
moment before):
"Sometimes the application is designed to send JavaScript code as a
response. If the content type of the response matches the MIME type of
JavaScript then this is true and Prototype will automatically eval()
returned code. You don't need to handle the response explicitly if you
don't need to."

So You don't even need to call eval() - Your JavaScript code will be
evaluated/run automatically.
All You need to do is:
 -  to send http Content-type as for example 'text/javascript', If You
send Your Ajax response using PHP this would look like this:
        <?php
                header("Content-type: text/javascript");
                echo '/* javascript code goes here */';
        ?>
 - or request with Ajax a file with ".js" extension (Apache will send
'text/javascript' automatically)
 - or send X-JSON header. In PHP it woul look like this:
        <?php
                header("X-JSON: '. '/* javascript code goes here */');
        ?>

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