I am making an AJAX call with jQuery to a PHP script that needs to return javascript code embedded in a JSON result for the jQuery code to execute. How do I go about passing jav
Two ways:
eval()
on the client side.
with its src
pointing to the server-side code that returns the new script.In either case, make sure you secure it well - if the user can somehow insert their own code into your response, they could do some damage.