how can I remove my appended script because it causes some problems in my app.
This is my code to get my script
var nowDate = new Date().getTime();
var url = val.redirect_uri + "notify.js?nocache=" + nowDate + "&callback=dummy";
var script = document.createElement('script');
script.src = url;
document.body.appendChild(script);
Then I have an auto load function, that causes to create another element script.
I want to get rid of the previous element that was appended before another element is added.
I did some more tests, and before you’ll get a correct answer to your question (hope there is a one) you can try this:
This is just a test code, but it contains an idea, how you possible could solve the problem. It removes
<sript>from the DOM, and the last line destroys all functionality of the script.(The code also has a little detail, which shows, that
setTimeoutwill doeval(), no matter how it is argumented…?)