remove activex fallback for internet explorer (#16453)
* remove IE6 XHR support IE7 and later support XMLHttpRequest natively, and most of the rest of the code base uses fetch() which may not work in any version of IE Drop the conditional here in the assumption that this would only be the first of many problems for a user with an unsupported browser.
This commit is contained in:
parent
097298a5e6
commit
39c5bcd518
6 changed files with 8 additions and 30 deletions
|
|
@ -21,11 +21,7 @@ function markNotificationsAsRead() {
|
|||
10,
|
||||
);
|
||||
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function () {};
|
||||
|
||||
var csrfToken = document.querySelector("meta[name='csrf-token']").content;
|
||||
|
|
|
|||
|
|
@ -132,11 +132,7 @@ function setCollectionFunctionality() {
|
|||
|
||||
function requestReactionCounts(articleId) {
|
||||
var ajaxReq;
|
||||
if (window.XMLHttpRequest) {
|
||||
ajaxReq = new XMLHttpRequest();
|
||||
} else {
|
||||
ajaxReq = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
ajaxReq = new XMLHttpRequest();
|
||||
ajaxReq.onreadystatechange = () => {
|
||||
if (ajaxReq.readyState === XMLHttpRequest.DONE) {
|
||||
var json = JSON.parse(ajaxReq.response);
|
||||
|
|
|
|||
|
|
@ -9,13 +9,10 @@ function removeExistingCSRF() {
|
|||
}
|
||||
}
|
||||
|
||||
/* TODO: prefer fetch() to XMLHttpRequest */
|
||||
function fetchBaseData() {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = () => {
|
||||
if (xmlhttp.readyState === XMLHttpRequest.DONE) {
|
||||
// Assigning CSRF
|
||||
|
|
|
|||
|
|
@ -28,11 +28,7 @@ function initializeCommentsPage() {
|
|||
for (var i = 0; i < commentableIdList.length; i++) {
|
||||
(function(i){
|
||||
var ajaxReq;
|
||||
if (window.XMLHttpRequest) {
|
||||
ajaxReq = new XMLHttpRequest();
|
||||
} else {
|
||||
ajaxReq = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
ajaxReq = new XMLHttpRequest();
|
||||
ajaxReq.onreadystatechange = function () {
|
||||
if (ajaxReq.readyState === XMLHttpRequest.DONE) {
|
||||
var responseObj = JSON.parse(ajaxReq.response);
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@
|
|||
}
|
||||
|
||||
function createAjaxReq() {
|
||||
if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest();
|
||||
} else {
|
||||
return new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -80,11 +80,8 @@
|
|||
window.location.pathname !== '/notifications'
|
||||
) {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == XMLHttpRequest.DONE) {
|
||||
var count = xmlhttp.response;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue