Say I\'ve got a Javascript string like the following
var fnStr = \"function(){blah1;blah2;blah3; }\" ;
(This may be from an expression the
You can also insert the string into a script element and then insert the script element into the page.
script_ele = window.document.createElement("script"); script_ele.innerHTML = 'function my_function(){alert("hi!");}'; window.document.body.appendChild(script_ele); my_function();