[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,20 +39,22 @@ Common.Locale = new(function() {
var _createXMLHTTPObject = function() { var _createXMLHTTPObject = function() {
var xmlhttp; var xmlhttp;
try { if (typeof XMLHttpRequest != 'undefined') {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); xmlhttp = new XMLHttpRequest();
} } else {
catch (e) {
try { try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} }
catch (E) { catch (e) {
xmlhttp = false; try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
} }
} }
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp; return xmlhttp;
}; };

View file

@ -634,20 +634,22 @@ Common.Utils.applyCustomizationPlugins = function(plugins) {
var _createXMLHTTPObject = function() { var _createXMLHTTPObject = function() {
var xmlhttp; var xmlhttp;
try { if (typeof XMLHttpRequest != 'undefined') {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest(); xmlhttp = new XMLHttpRequest();
} else {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
} }
return xmlhttp; return xmlhttp;
}; };
@ -690,17 +692,19 @@ Common.Utils.fillUserInfo = function(info, lang, defname) {
Common.Utils.createXhr = function () { Common.Utils.createXhr = function () {
var xmlhttp; var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); if (typeof XMLHttpRequest != 'undefined') {
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest(); xmlhttp = new XMLHttpRequest();
} else {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
} }
return xmlhttp; return xmlhttp;