Permalink
Browse files

Fix 'Operation aborted' error message in some versions of IE6.

  • Loading branch information...
1 parent b21c578 commit 94d582668d389a010ad96007f2f87d2c55d0d298 @rolftimmermans committed Apr 25, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 respond.src.js
View
@@ -308,7 +308,18 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){
})();
//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
respond.update = ripCSS;

0 comments on commit 94d5826

Please sign in to comment.