How do I execute some JavaScript that is a string?
function ExecuteJavascriptString() { var s = "alert('hello')"; // how do I get a browser to alert('hello')? }
With the eval function, like:
eval
eval("my script here");
1.4m articles
1.4m replys
5 comments
57.0k users