I am appending external scripts inside the head tag using the following code which I got here: How to Append <script></script> in javascript?.
var s = document.createElement("script");
s.type = "text/javascript";
s.src = url;
$("head").append(s);
It works fine, except for that sometimes, the script that I am appending is already duplicated, hence affecting the logic of the page.
Is there anyway to check for duplicate external scripts and then remove it if true?