Skip to content

IE11 does not support script.readyState #3

@wonsure2

Description

@wonsure2

code:

// 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');

// I create a array here, otherwise the iterator will not be executed in each method
var scriptsArr = [];
for (var i = 0; i < scripts.length; i++) {
scriptsArr.push(scripts.item(i));
}

each(scriptsArr, function (script) {
if (script.readyState === 'interactive') { // script.readyState is undefined in IE11 !!!!!!!!!!!!!!!!!!!!!!!!!!!
interactiveScript = script;
return false;
}
});
return interactiveScript;

problem:
script.readyState is undefined in IE11,so it can not get the script which is running

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions