[common] ActiveXObject for XMLHttpRequest failed in IE11 for some requests

This commit is contained in:
Maxim Kadushkin 2019-03-12 17:02:38 +03:00
parent 8499e4d47b
commit 0fc75a9ab5
2 changed files with 39 additions and 33 deletions

View file

@ -39,6 +39,9 @@ Common.Locale = new(function() {
var _createXMLHTTPObject = function() {
var xmlhttp;
if (typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
} else {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
@ -50,9 +53,8 @@ Common.Locale = new(function() {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
};

View file

@ -634,6 +634,9 @@ Common.Utils.applyCustomizationPlugins = function(plugins) {
var _createXMLHTTPObject = function() {
var xmlhttp;
if (typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
} else {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
@ -645,9 +648,8 @@ Common.Utils.applyCustomizationPlugins = function(plugins) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
};
@ -690,6 +692,10 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
Common.Utils.createXhr = function () {
var xmlhttp;
if (typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
} else {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
@ -699,8 +705,6 @@ Common.Utils.createXhr = function () {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;