In less words:
I have multiple JavaScript sections located at different places in document. Some of them are loaded and evaluated with AJAX:
<script id="js5533" type="text/javascript">
javascript and jquery stuff (lots)
</script>
<script id="js7711" type="text/javascript">
javascript and jquery stuff (lots)
</script>
As you can see I ID every section.
My goal is to get rid of specific section by clicking on button.
$('.somebutton').click(function() {
$('#js7711').remove();
});
Of course this function removes only element from the document and all JavaScript functions in section js7711 are still working.
I don't want to manually remove every function and variable from the section by doing things like a(); a = 0;
Are there any less coding solutions?
Thanks.
P.S. jQuery is also used.