Skip to content
Snippets Groups Projects
Commit 5f0cc61e authored by Ben Adida's avatar Ben Adida
Browse files

Merge pull request #1877 from mozilla/issue_1867_xhr

Reverse the order of checking for window.XMLHttpRequest and window.Activ...
parents 1835ce14 e0074031
No related branches found
No related tags found
No related merge requests found
/*jshint browsers:true, forin: true, laxbreak: true */
/*jshint browser:true, forin: true, laxbreak: true */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
......@@ -17,12 +17,16 @@ window.Micrajax = (function() {
function getXHRObject() {
var xhrObject;
if (window.ActiveXObject) {
xhrObject = new ActiveXObject('Microsoft.XMLHTTP');
}
else if (window.XMLHttpRequest) {
// From http://blogs.msdn.com/b/ie/archive/2011/08/31/browsing-without-plug-ins.aspx
// Best Practice: Use Native XHR, if available
if (window.XMLHttpRequest) {
// If IE7+, Gecko, WebKit: Use native object
xhrObject = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
// ...if not, try the ActiveX control
xhrObject = new ActiveXObject('Microsoft.XM/LHTTP');
}
return xhrObject;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment