Skip to content

Commit 0dbb4d5

Browse files
add extra check if dom is ready
1 parent e1a153c commit 0dbb4d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/Utilities/DOMReady.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ if (document.readyState) checks.push(function(){
7373
return (state == 'loaded' || state == 'complete');
7474
});
7575

76-
if ('onreadystatechange' in document) document.addListener('readystatechange', check);
76+
if ('onreadystatechange' in document){
77+
document.addListener('readystatechange', check);
78+
var state = document.readyState;
79+
if (state == 'loaded' || state == 'complete') domready();
80+
}
7781
else shouldPoll = true;
7882

7983
if (shouldPoll) poll();

0 commit comments

Comments
 (0)