How to abort script loading
<p>Is it possible to stop loading of the JS file loaded in the below way, are there any event handlers?   </p>

<pre><code>function makeScript(url){    
    script = document.createElement("script");
    script.src = url;
    //when this line is executed the script will be loaded by the browser
    //is there an event where the below script loading can be stopped based                                                                   
    //on some condition                        
    document.head.appendChild(script); 
}
</code></pre>

<p>I do not want to load the script via ajax call as the js file does not appear under sources tab of Chrome Debugger Tool. There are possible solutions like using <code>//# sourceURL=dynamicScript.js</code>, but I will have to put this line in all the js files. I do not want to edit all the js files.If change is localized to 1 place it is good.</p>