Skip to content

Commit 5194009

Browse files
author
scottjehl
committed
shortened the ajax factory down to not use a loop.
1 parent 625d77d commit 5194009

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

respond.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

respond.src.js

+6-15
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,12 @@
211211
},
212212
//define ajax obj
213213
xmlHttp = (function() {
214-
var xmlhttpmethod = false,
215-
attempts = [
216-
function(){ return new ActiveXObject("Microsoft.XMLHTTP") },
217-
function(){ return new XMLHttpRequest() }
218-
],
219-
al = attempts.length;
220-
221-
while( al-- ){
222-
try {
223-
xmlhttpmethod = attempts[ al ]();
224-
}
225-
catch(e) {
226-
continue;
227-
}
228-
break;
214+
var xmlhttpmethod = false;
215+
try {
216+
xmlhttpmethod = XMLHttpRequest();
217+
}
218+
catch( e ){
219+
xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" );
229220
}
230221
return function(){
231222
return xmlhttpmethod;

0 commit comments

Comments
 (0)