获取当前script

function getCurrentScript() {
if (document.currentScript) {
return document.currentScript;
}

// For IE6-9 browsers, the script onload event may not fire right
// after the script is evaluated. Kris Zyp found that it
// could query the script nodes and the one that is in "interactive"
// mode indicates the current script
// ref: http://goo.gl/JHfFW
var scripts = document.getElementsByTagName("script")

for (var i = scripts.length - 1; i >= 0; i--) {
    var script = scripts
    if (script.readyState === "interactive") {
        interactiveScript = script
        return interactiveScript
    }
}

}