As the title says, if I remove a script tag from the DOM using:
$(\'#scriptid\').remove();
Does the javascript itself remain in memory or i
If your scripts have already executed removing the DOM elements are not going to get rid of them. Go to any page with JavaScript, open up your preferred javascript console and type $("script").remove(). Everything keeps running.
And this demonstrates @Kolink answer:
http://jsfiddle.net/X2mk8/2/
HTML:
Javascript:
$("script").remove();
// or $("#yourDynamicGeneratedScript").remove();
test(2);
test(3);
test(4);
function test(n) {
$output = $("#output")
$output.append("REDEFINED! " + n + "
")
}
test(5);
test(6);
test(7);