Skip to content

Commit

Permalink
Fix 'Operation aborted' error message in some versions of IE6.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolftimmermans committed Apr 25, 2012
1 parent b21c578 commit 94d5826
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion respond.src.js
Expand Up @@ -308,7 +308,18 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){
})(); })();


//translate CSS //translate CSS
ripCSS(); if( document.attachEvent ){
// Avoid "Operation aborted" error in IE6 by waiting until the DOM is loaded.
var DOMLoaded = function() {
if( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMLoaded );
ripCSS();
}
};
document.attachEvent( "onreadystatechange", DOMLoaded );
} else {
ripCSS();
}


//expose update for re-running respond later on //expose update for re-running respond later on
respond.update = ripCSS; respond.update = ripCSS;
Expand Down

0 comments on commit 94d5826

Please sign in to comment.