From 3c8a2f2544ca396f04b5dd335402e58f4a6a7f55 Mon Sep 17 00:00:00 2001 From: Lindsay Bernath Date: Fri, 19 Oct 2012 17:41:45 -0400 Subject: [PATCH] wrapped recursive call to makeRequests in setTimeout to previent "stack overflow" in ie7 --- respond.src.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/respond.src.js b/respond.src.js index 1eb45acd..5f80a00e 100644 --- a/respond.src.js +++ b/respond.src.js @@ -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); } ); } },