Skip to content

Commit

Permalink
wrapped recursive call to makeRequests in setTimeout to previent "sta…
Browse files Browse the repository at this point in the history
…ck overflow" in ie7
  • Loading branch information
hellolindsay committed Oct 19, 2012
1 parent b21c578 commit 3c8a2f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion respond.src.js
Expand Up @@ -99,7 +99,10 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){
ajax( thisRequest.href, function( styles ){
translate( styles, thisRequest.href, thisRequest.media );
parsedSheets[ thisRequest.href ] = true;
makeRequests();

// by wrapping recursive function call in setTimeout
// we prevent "Stack overflow" error in IE7
setTimeout(function(){ makeRequests(); },0);
} );
}
},
Expand Down

0 comments on commit 3c8a2f2

Please sign in to comment.