aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax/xhr.js
Commit message (Collapse)AuthorAgeFilesLines
* Ajax: Support `null` as success functions in `jQuery.get`Michał Gołębiowski-Owczarek2022-10-171-1/+0
| | | | | | | | | | | | | According to the docs, one can use `null` as a success function in `jQuery.get` of `jQuery.post` so the following: ```js await jQuery.get( "https://httpbin.org/json", null, "text" ) ``` should get the text result. However, this shortcut hasn't been working so far. Fixes gh-4989 Closes gh-5139
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-041-2/+2
| | | | | | | | | | | | | The GitHub UI treats `#NUMBER` as referring to its own issues which is confusing when in jQuery source it's usually referring to the old deprecated Trac instance at https://bugs.jquery.com. This change replaces all such Trac references with `trac-NUMBER`. A few of the references came with the Sizzle integration and referred to the Sizzle GitHub bug tracker. Those have been replaced with full links instead. A new entry describing issue reference conventions has been added to README. Closes gh-4993
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-051-3/+3
| | | | | | | | 1. Correct code indentations based on jQuery Style Guide (contribute.jquery.org/style-guide/js/#spacing). 2. Add rules to "src/.eslintrc.json" to enable "enforcing consistent indentation", with minimal changes to the current code. Closes gh-4672
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-7/+2
| | | | | | | | | | | | | | | | | | | | | | Migrate all source AMD modules to ECMAScript modules. The final bundle is compiled by a custom build process that uses Rollup under the hood. Test files themselves are still loaded via RequireJS as that has to work in IE 11. Tests can now be run in "Load as modules" mode which replaces the previous "Load with AMD" option. That option of running tests doesn't work in IE and Edge as it requires support for dynamic imports. Some of the changes required by the migration: * check `typeof` of `noGlobal` instead of using the variable directly as it's not available when modules are used * change the nonce module to be an object as ECMASscript module exports are immutable * remove some unused exports * import `./core/parseHTML.js` directly in `jquery.js` so that it's not being cut out when the `ajax` module is excluded in a custom compilation Closes gh-4541
* Ajax: Simplify jQuery.ajaxSettings.xhrMichał Gołębiowski-Owczarek2019-08-261-3/+1
| | | | | | | | | | | | | | | 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
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-291-133/+85
| | | | | | | | | | | Also, update support comments format to match format described in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197 with the change from: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379 (open-ended ranges end with `+`). Fixes gh-3950 Fixes gh-4299 Closes gh-4347
* Ajax: add an ontimeout handler to all requestsErik Lax2017-07-241-2/+3
| | | | | Fixes gh-3586 Close gh-3590
* Build: Put all AMD modules in "src/" in strict modeMichał Gołębiowski2016-04-251-0/+2
| | | | Fixes gh-3073
* Docs: Update support comments to follow the new syntaxMichał Gołębiowski2016-03-301-4/+4
| | | | | The changes follow the spec proposed in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
* Docs:Tests: Remove obsolete code from tests, update support commentsMichał Gołębiowski2016-03-081-3/+3
| | | | | | | | | | Support comments that were lacking the final IE/Edge version that exhibits the bug were checked & updated. Links to the Chromium bug tracker were updated. Code in tests related to unsupported browsers (like Android 2.3 in non-basic tests) has been removed. Fixes gh-2868 Closes gh-2949
* Ajax: Don't throw exceptions on binary data responseDave Methvin2015-11-041-6/+7
| | | | | | | | | Fixes gh-2498 Closes gh-2682 The added unit test shows how this could be used to support an ArrayBuffer return, but $.ajax does not support it natively. The goal with this change was to avoid the exception.
* Ajax: trigger error callback on native abortTimmy Willison2015-11-031-8/+41
| | | | | | | - IE9 does not have onabort. Use onreadystatechange instead. Fixes gh-2079 Close gh-2684
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-10/+16
| | | | Fixes gh-2056
* Ajax: remove "onunload" event handlerOleg Gaidarenko2015-05-031-18/+3
| | | | | | | | | Remove hack for IE lost connections, update for it was released by Microsoft at November 12, 2013. See https://support.microsoft.com/en-us/kb/2905733 Ref trac-5280 Ref gh-2047
* Build: Don't assume the browser environment; smoke test on Node w/ jsdomMichał Gołębiowski2014-12-261-1/+1
| | | | | Fixes gh-1950 Closes gh-1949
* Ajax: remove event dependency from the ajax moduleOleg Gaidarenko2014-10-141-2/+3
| | | | Closes gh-1695
* Build: update grunt-jscs-checker and pass with the new rulesTimmy Willison2014-07-171-2/+8
|
* Ajax: Protect against exceptions thrown synchronously by xhr.sendjaubourg2014-01-291-4/+9
| | | | | | | | | | | When xhr.send throws an exception synchronously, the onerror handler may have been called already which, unchecked, makes the exception bubble up outside of jQuery.ajax. We now catch the exception pre-emptively and only rethrow if we know it hasn't already been notified through the onerror handler. Fixes #14683
* Revert "Ajax: Fix #14424. Use ActiveX in IE9+ on local files, close gh-1434."Dave Methvin2013-12-151-8/+0
| | | | | | This reverts commit 498e0e6c9bf486a0b1f16b455d65fcbc6c43867e. We can't use the ActiveX XHR because it doesn't support events.
* Ajax: Fix #14424. Use ActiveX in IE9+ on local files, close gh-1434.Dave Methvin2013-11-141-0/+8
| | | | | We can't feature detect ActiveX in IE11, but we can just call it and catch whatever error occurs, then try normal XHR.
* ajax: Fix #14207. file protocol returns status 0, see #8605.Dave Methvin2013-11-131-2/+2
|
* No ticket: Update support comment to match conventionRichard Gibson2013-11-041-2/+2
|
* No ticket: Small ajax/xhr size optimizationsRichard Gibson2013-10-281-6/+19
|
* Fix #14379: AJAX requests on unloadRichard Gibson2013-10-281-4/+2
|
* No ticket: fix code style inconsistencies. Closes gh-1361Oleg2013-09-131-1/+1
|
* Fix #10814. Make support tests lazy and broken out to components.Michał Gołębiowski2013-09-061-6/+6
|
* Specify support as a dependency wherever it is used. Optimize module order ↵Timmy Willison2013-08-151-1/+2
| | | | to save 15 bytes.
* AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.Timmy Willison2013-08-151-0/+7
|
* Adds the abort on unload trick back in since IE9 still exhibits the bugjaubourg2013-01-071-4/+19
|
* Fixes comments per @rwldrn. Makes sure failing requests from local protocol ↵jaubourg2013-01-071-6/+10
| | | | yields status 404, not 0.
* 2.0: reduced xhr transportjaubourg2013-01-071-210/+84
|
* Fix #10417. setTimeout w/o 2nd arg is jQuery.later! Close gh-1065.Oleg2012-12-101-1/+1
|
* No ticket: compress ajax. Close gh-1041.Richard Gibson2012-11-251-18/+16
|
* Alternate fix for #11426; check responseText. Close gh-843.Oleg Gaidarenko2012-10-201-2/+1
|
* Latest JSHint gets cranky with the _ vars in catch() {}Rick Waldron2012-10-151-2/+2
|
* Fixes a variety of typographical problems. Closes gh-853Chris Faulkner2012-07-111-1/+1
|
* Follow the style guide, lose 72 bytes! Closes gh-840.Mike Sherov2012-07-091-6/+5
|
* Strips IIFEs from modules; Always require built jQuery for tests.Rick Waldron2012-06-041-4/+0
|
* When IE6 & IE7 serve from the cache in async mode, resolves the request ↵jaubourg2012-05-161-4/+6
| | | | asynchronously. Fixes #11778.
* Fixes #11426: getting the responseText of an xhr should be tried/caught ↵jaubourg2012-03-071-1/+7
| | | | because of IE's inability to give access to binary data. Unit test added.
* Add undef:true to JSHint now that it understands hoistingMike Sherov2012-01-191-5/+5
| | | | also add smarttabs:true and fix some smarttabs spacing issues
* Fix #10692. JSLint is dead! Long live JSHint!Mike Sherov2011-12-081-5/+5
| | | | Still needs this sizzle PR: https://github.com/jquery/sizzle/pull/82
* Makes sure no unload handler is bound when not in IE. Also simplifies the ↵jaubourg2011-04-211-30/+26
| | | | whole "on unload abort" code. Also avoids the declaration of yet another variables in the jQuery main closure for the temporary XHR used to assess support properties.
* (Re) Fixes #8884 in a way that keeps the format of the headers map sent to ↵jaubourg2011-04-191-1/+1
| | | | transports natural.
* Removes now unnecessary regexp and companion function. Fixes some spacing ↵jaubourg2011-04-151-1/+1
| | | | issues. Shortens field names.
* Continuing to map request headers using their name in uppercase for the ↵Sam Bisbee2011-04-151-1/+1
| | | | index, but we now map to an object with an unmodified name and value: { name: "", value: "" }. This prevents overwriting of the user's supplied headers, which many applications parse with case sensitivity, because we no longer use the modified, uppercase index when building the request.
* Fixes #8423. Never set X-Requested-With header automagically for ↵jaubourg2011-03-071-5/+6
| | | | cross-domain requests.
* Minor changes to enforce JQuery Core Style Guidelines.jaubourg2011-02-121-9/+11
|
* Adds missing crossDomain test.jaubourg2011-02-111-1/+1
|
* Fixes #8245. Ajax now ensures header names are capitalized so that ↵jaubourg2011-02-111-2/+2
| | | | non-compliant xhr implementations don't override them.