function loadScript(url,callback) {
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" ||
script.readyState == "complete"){
script.onreadystatechange = null;
script.parentNode.removeChild( script );
callback();
}
};
} else { //Others
script.onload = function(){
this.parentNode.removeChild(this);
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
<div><include src="banner.html"></include></div>
<a href="1"><img src="1"></a><a href="2"><img src="2"></a>