What i am trying is - http://jsfiddle.net/jhrz9/1/
to remove the script generated when someone clicks the button #goBack button Now i am able to create and append script and style tags when the user clicks the #runMyCode But as soon as i go back to the previous screen using #goBack button the script stays on the screen, now what i want to do is to remove that script and create another one again when i click the #runMyCode button
Now i am trying this -
var newScript = document.createElement('script'); ;
var newTextNode=document.createTextNode($("#jsTextArea").val());
newScript.type = 'text/javascript';
newScript.appendChild(newTextNode);
document.body.appendChild(newScript);
$('#goBack').click(function(){
newTextNode.parentNode.removeChild(newTextNode);
});
But for some reason it is not working....
iframe, it will still be in memory, and possibly even be able to tamper with your code. Since you already have this in a JSFiddle, try to fiddle around with it and see how it works.