aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax/xhr.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2019-08-26 19:01:26 +0200
committerGitHub <noreply@github.com>2019-08-26 19:01:26 +0200
commitabdc89ac2e581392b800c0364e0f5f2b6a82cdc6 (patch)
treed3cc7599ff1ffdccf22cf708233f87b609dec00a /src/ajax/xhr.js
parentd7e64190efc411e3973a79fd027bf1afe359f429 (diff)
downloadjquery-abdc89ac2e581392b800c0364e0f5f2b6a82cdc6.tar.gz
jquery-abdc89ac2e581392b800c0364e0f5f2b6a82cdc6.zip
Ajax: Simplify jQuery.ajaxSettings.xhr
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catch as we defined jQuery.support.ajax & jQuery.support.cors executed during the jQuery load and we didn't want to crash if IE had native XHR disabled (which is possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0, jQuery with XHR disabled could still be used for its other features in such a crippled browser. Since gh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, so we don't need the try-catch anymore. Fixes gh-1967 Closes gh-4467 Ref gh-4347
Diffstat (limited to 'src/ajax/xhr.js')
-rw-r--r--src/ajax/xhr.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index 16a2ac3d8..3578ba167 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -6,9 +6,7 @@ define( [
"use strict";
jQuery.ajaxSettings.xhr = function() {
- try {
- return new window.XMLHttpRequest();
- } catch ( e ) {}
+ return new window.XMLHttpRequest();
};
var xhrSuccessStatus = {