[ticket/13740] Remove ActiveXObject as it is supported by IE versions >= 8

PHPBB3-13740
This commit is contained in:
CHItA 2015-06-14 13:36:45 +02:00 committed by Mate Bartus
parent aa6a1c5939
commit 5ce170dcc3

View file

@ -3,7 +3,6 @@
*/ */
(function($) { // Avoid conflicts with other libraries (function($) { // Avoid conflicts with other libraries
'use strict'; 'use strict';
// Installer variables // Installer variables
@ -26,18 +25,11 @@
* as of now, jQuery does not provide access to the response until * as of now, jQuery does not provide access to the response until
* the connection is not closed. * the connection is not closed.
* *
* @return XMLHttpRequest|ActiveXObject * @return XMLHttpRequest
*/ */
function createXhrObject() { function createXhrObject() {
var xhReq; var xhReq = new XMLHttpRequest();
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
if (window.XMLHttpRequest) {
xhReq = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xhReq = new ActiveXObject("Msxml2.XMLHTTP");
}
return xhReq; return xhReq;
} }
@ -336,7 +328,6 @@
var xhReq = createXhrObject(); var xhReq = createXhrObject();
xhReq.open('POST', $form.attr('action'), true); xhReq.open('POST', $form.attr('action'), true);
xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhReq.send(getFormFields($form, $submitBtn)); xhReq.send(getFormFields($form, $submitBtn));