Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 does not support script.readyState #3

Open
wonsure2 opened this issue Feb 9, 2021 · 0 comments
Open

IE11 does not support script.readyState #3

wonsure2 opened this issue Feb 9, 2021 · 0 comments

Comments

@wonsure2
Copy link

wonsure2 commented Feb 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant