file - How to remove script tags -
i have loaded many script files:
eg:
<script type="text/javascript" src=" script file "></script> <script type="text/javascript" src=" script file "></script> $('button').on('click', function() { $('script').remove(); // script events still functioning. });
if script loaded, cannot un-load it. removing <script>
tag page won't have effect.
a better option: event handler or event listener can removed using jquery's .off()
function or javascript's removeeventlistener()
.
Comments
Post a Comment