Processing javascript from ajax response?

Sgraffite

Supreme [H]ardness
Joined
Jan 10, 2006
Messages
4,405
I'm loading content from an ajax response that contains:
Code:
<script type="text/javascript">alert('here');</script>

I can't get the javascript to execute though. I've tried both prototype and jquery and neither seem to want to execute javascript within the response text.

Prototype has an evalJS flag you can set to true, however it appears to have no effect on getting the javascript within the ajax response text to run.

Has anyone been able to do this?
 
Usually you write the javascript in the requesting page not in the response, ajax is used to get server side stuff only. But if you insist eval should work, but don't put the script tags just the javascript.
 
Back
Top