Once you've loaded a javascript, you can't cancel it. Lets say, we have a script like
<script language="text/javascript" id="ourtest">
function callme(){
alert('yay');
}
</script>
We now could call
$(document).ready(function(){
callme();
});
which would alert us like expected.
We also can do something like
$('#ourtest').html('');
or
$('#ourtest').remove();
which would work (we can overwrite the html and even remove the whole script block), but the code was already executed and its loaded into memory. So the function callme()
would still work.
Long story short, you can't make an undo
for a script block unless you reload the page.