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();
v
In case of JSONP and your use of jQuery, why not take full advantage of jQuery's JSONP loading facilities, which do the post-clean-up for you? Loading JSONP resource like this, doesn't leave a trace in the DOM:
$.ajax({ url: 'http://example.com/', dataType: 'jsonp' })
The tag used for loading is removed instantly as soon it's loaded. If the loading is a success. On the other hand, failed requests don't get cleared automatically and you have to do that yourself with something like this:
$('head script[src*="callback="]').remove();
called at the right time. It removes all pending JSONP tags.