Hi Jonathon ..
You are giving the request the wrong parameter ...
You dont need to set a header of text/javascript either
evalJS : true,
making your script
new Ajax.Request('test.php', {
evalJS: true, // <----- notice evalJS not evalScripts
onSuccess: function(transport) {
$('canvas').innerHTML = transport.responseText;
},
onFailure: function() {
err = '<h1>Unable to connect to server, operation cancelled</h1>';
$('canvas').innerHTML = err + $('canvas').innerHTML;
showWait(false);
}
}
Enjoy
/Alex
----- Original Message -----
From: "jonathon" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" <[email protected]>
Sent: Friday, November 07, 2008 2:51 AM
Subject: [Proto-Scripty] unable to evaluate javascript in Ajax.Request
response
>
> Hello,
>
> I'm having difficulty getting something to work. Perhaps someone will
> know the solution?
>
> The function:
>
> new Ajax.Request('test.php', {
> evalScripts: true,
> onSuccess: function(transport) {
> $('canvas').innerHTML = transport.responseText;
> },
> onFailure: function() {
> err = '<h1>Unable to connect to server, operation cancelled</h1>';
> $('canvas').innerHTML = err + $('canvas').innerHTML;
> showWait(false);
> }
> }
>
> I read in the api that you need to set the contentType to 'text/
> javascript', so I did that in my php:
>
> <? header("Content-type: text/javascript"); ?>
> <script type='text/javascript'>alert('hi');</script>
>
> I am never alerted though... Any ideas? Thanks!!!
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---