查询相关资料,ie11中已经移除readyState,各位朋友有没有什么好方案解决这个问题。
var getCurScript = function() { if(document.currentScript) { return document.currentScript; } var head = document.getElementsByTagName(‘head’)[0], nodes = head.getElementsByTagName(‘script’), currentScript; nodes = this.makeArray( nodes ); for(var i = 0, len = nodes.length; i < len; i++ ) { var node = nodes[i]; if( node.readyState === ‘interactive’) { currentScript = node; } }
return currentScript;
};