document.readyState
Firefoxã§document.readyStateããµãã¼ãããã¦ããã確èªãããã¼ã¸ã§ã³ã¯Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090124 Minefield/3.2a1preã
document.readyStateã§ãdocument.readyStateãã©ã®ãããªå¤ã«ãªããä¸è¦§ã§ããããã«ãã
Safariãdocument.readyStateããµãã¼ãããã¦ãããã©ãFirefoxã¨ã¯è¿ãæååãéããFirefoxã®å ´åã¯
- uninitialized
- loading
- (DOMContentLoadedã¤ãã³ããçºç)
- interactive
- (loadã¤ãã³ããçºç)
- complete
ã§ãSafariã®å ´åã¯
- loading
- (DOMContentLoadedã¤ãã³ããçºç)
- loaded
- (loadã¤ãã³ããçºç)
- complete
ã¨ãªã£ã¦ããã
ドキュメント(Document)ã«ããã¨IEã§ããµãã¼ãããã¦ããããã§ãIEã¯Firefoxã¨åãinteractiveããµãã¼ãããã¦ããã
uninitializedã¨ããå¤ã¯
alert( document.body.appendChild( document.createElement('iframe') ).contentDocument.readyState );
ã¨ããã¨çºçããããã ãSafariã¯completeã¨è¡¨ç¤ºããã
Firefox2çã§document.readyStateã使ç¨ããã«ã¯ã
if (!('readyState' in document)) { document.readyState = 'loading'; document.addEventListener( 'DOMContentLoaded', function listener() { document.readyState = 'interactive'; this.removeEventListener('DOMContentLoaded', listener, false); }, false ); document.addEventListener( 'load', function listener() { document.readyState = 'complete'; this.removeEventListener('load', listener, false); }, false ); }
ã¨ããã°ããã
document.readyStateã使ç¨ããã¨
// CSSããã°ã«ãã javascript: (function ready(fun) { if (document.readyState === 'complete') fun(); else window.addEventListener('load', fun, false); })(function () { // DOMã使ç¨ããã³ã¼ã Array.prototype.forEach.call( document.querySelectorAll('link[rel~="stylesheet"], style'), function (elem) { elem.disabled =! elem.disabled; } ); });
ã®ããã«documentãå®å ¨ã«loadãããã¾ã§å¾ ã£ã¦ããã¹ã¯ãªãããåä½ãããã¨ãã£ãäºãå¯è½ã«ãªãã