Skip to content
This repository
Browse code

wrapped recursive call to makeRequests in setTimeout to previent "sta…

…ck overflow" in ie7
  • Loading branch information...
commit 3c8a2f2544ca396f04b5dd335402e58f4a6a7f55 1 parent b21c578
Lindsay authored October 19, 2012

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  respond.src.js
5  respond.src.js
@@ -99,7 +99,10 @@ window.matchMedia = window.matchMedia || (function(doc, undefined){
99 99
 				ajax( thisRequest.href, function( styles ){
100 100
 					translate( styles, thisRequest.href, thisRequest.media );
101 101
 					parsedSheets[ thisRequest.href ] = true;
102  
-					makeRequests();
  102
+
  103
+					// by wrapping recursive function call in setTimeout 
  104
+					// we prevent "Stack overflow" error in IE7
  105
+					setTimeout(function(){ makeRequests(); },0);
103 106
 				} );
104 107
 			}
105 108
 		},

0 notes on commit 3c8a2f2

Please sign in to comment.
Something went wrong with that request. Please try again.