aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
Commit message (Collapse)AuthorAgeFilesLines
* Core: Use named exports in `src/`Michał Gołębiowski-Owczarek2023-09-121-7/+7
| | | | | | | | | The `default` export is treated differently across tooling when transpiled to CommonJS - tools differ on whether `module.exports` represents the full module object or just its default export. Switch `src/` modules to named exports for tooling consistency. Fixes gh-5262 Closes gh-5292
* Ajax: Support binary data (including FormData)Michał Gołębiowski-Owczarek2023-02-011-3/+3
| | | | | | | | | | | | Two changes have been applied: * prefilters are now applied before data is converted to a string; this allows prefilters to disable such a conversion * a prefilter for binary data is added; it disables data conversion for non-string non-plain-object `data`; for `FormData` bodies, it removes manually-set `Content-Type` header - this is required as browsers need to append their own boundary to the header Ref gh-4150 Closes gh-5197
* Ajax: Support `null` as success functions in `jQuery.get`Michał Gołębiowski-Owczarek2022-10-171-2/+3
| | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | 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
* Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)Michał Gołębiowski-Owczarek2020-09-221-1/+1
| | | | | | | | | | | | Drop support for Edge Legacy: the non-Chromium, EdgeHTML-based Microsoft Edge version. Also, restrict some workarounds that were applied unconditionally in all browsers to run only in IE now. This slightly increases the size but reduces the performance burden on modern browsers that don't need the workarounds. Also, clean up some comments & remove some obsolete workarounds. Fixes gh-4568 Closes gh-4792
* Ajax: Execute JSONP error script responsesDallas Fraser2020-08-251-2/+4
| | | | | | | | | | | | Issue gh-4379 was meant to be a bug fix but the JSONP case is a bit special: under the hood it's a script but it simulates JSON responses in an environment without a CORS setup and sending JSON payloads on error responses is quite typical there. This commit makes JSONP error responses still execute the payload. The regular script error responses continue to be skipped. Fixes gh-4771 Closes gh-4773
* Build: Followups after introducing ES modules compiled via RollupMichał Gołębiowski-Owczarek2020-05-051-1/+1
| | | | | | | | | | This commit cleans up a few comments & configurations that are out of date after the migration to ES modules backed by a Rollup-based compilation. Also, de-indent AMD modules. This will preserve a more similar structure to the one on 3.x-stable where the body of the main `define` wrapper is not indented. Closes gh-4705
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-051-3/+4
| | | | | | | | 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
* Ajax: Overwrite s.contentType with content-type header value, if anyChristian Wenz2020-04-061-0/+9
| | | | | | | | | | | This fixes the issue of "%20" in POST data being replaced with "+" even for requests with content-type different from "application/x-www-form-urlencoded", e.g. for "application/json". Fixes gh-4119 Closes gh-4650 Co-authored-by: Richard Gibson <richard.gibson@gmail.com> Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
* Build:Tests: Fix custom build tests, verify on Travis Michał Gołębiowski-Owczarek2020-01-071-1/+1
| | | | | | | | | | | This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The future (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Closes gh-4577
* Build: Fix the import path to serialize.js from ajax.jsMichał Gołębiowski-Owczarek2019-11-191-1/+1
|
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-19/+15
| | | | | | | | | | | | | | | | | | | | | | 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: Do not execute scripts for unsuccessful HTTP responsesSean Robinson2019-09-261-0/+5
| | | | | | | | | The script transport used to evaluate fetched script sources which is undesirable for unsuccessful HTTP responses. This is different to other data types where such a convention was fine (e.g. in case of JSON). Fixes gh-4250 Closes gh-4379
* Build: ESLint: forbid unused function parametersMichał Gołębiowski-Owczarek2019-05-131-1/+1
| | | | | | | | | | | | | This commit requires all function parameters to be used, not just the last one. In cases where that's not possible as we need to match an external API, there's an escape hatch of prefixing an unused argument with `_`. This change makes it easier to catch unused AMD dependencies and unused parameters in internal functions the API of which we may change at will, among other things. Unused AMD dependencies have been removed as part of this commit. Closes gh-4381
* Core: Remove IE-specific support tests, rely on document.documentModeMichał Gołębiowski-Owczarek2019-05-131-0/+6
| | | | | | | Also, update some tests to IE-sniff when deciding whether to skip a test. Fixes gh-4386 Closes gh-4387
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-291-6/+5
| | | | | | | | | | | 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: Fix getResponseHeader(key) for IE11Andrei Fangli2018-11-261-3/+5
| | | | | | | | | | | - getResponseHeader(key) combines all header values for the provided key into a single result where values are concatenated by ', '. This does not happen for IE11 since multiple values for the same header are returned on separate lines. This makes the function only return the last value of the header for IE11. - Updated ajax headers test to better cover Object.prototype collisions Close gh-4173 Fixes gh-3403
* Ajax: Don't process non-string data property on no-entity-body requestsDave Methvin2018-01-151-2/+2
| | | | | Fixes gh-3438 Closes gh-3781
* Core: deprecate jQuery.isFunctionJason Bedard2018-01-151-3/+4
| | | | Fixes gh-3609
* Docs:Tests: Update IE/Edge-related support comments & testsMichał Gołębiowski2017-05-151-1/+1
| | | Closes gh-3661
* Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapseTimmy Willison2016-09-151-4/+4
| | | | | | | | | | | | - Renames and changes rnotwhite to focus on HTML whitespace chars - Change internal use of jQuery.trim to more accurate strip and collapse - Adds tests to ensure HTML space characters are retained where valid - Doesn't add tests where the difference is inconsequential and existing tests are adequate. Fixes gh-3003 Fixes gh-3072 Close gh-3316
* Ajax: Don't mangle the URL when removing the anti-cache paramDave Methvin2016-08-081-3/+3
| | | | | Fixes gh-3229 Closes gh-3253
* Build: ESLint detailsOleg Gaidarenko2016-06-111-0/+1
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Ajax: Remove unnecessary use of jQuery.trimRalin Chimev2016-04-291-1/+1
| | | | | | | The subsequent .match already ignores leading/trailing space. Ref gh-3003 Closes gh-3095
* Build: Put all AMD modules in "src/" in strict modeMichał Gołębiowski2016-04-251-0/+2
| | | | Fixes gh-3073
* Docs: Update support comments related to IEMichał Gołębiowski2016-03-301-3/+4
| | | | All support comments were checked for Edge applicability.
* Core: Deprecate jQuery.parseJSONMichał Gołębiowski2016-03-021-2/+1
| | | | | Fixes gh-2800 Closes gh-2948
* Ajax: add serialize to AMD dependenciesTimmy Willison2016-01-191-1/+2
| | | | Fixes gh-2842
* Ajax: Preserve URL hash on requestsDave Methvin2015-11-301-12/+16
| | | | | Fixes gh-1732 Closes gh-2721
* Ajax: Golf away 21 bytesRichard Gibson2015-11-191-30/+28
| | | | Close gh-2699
* Event: Separate trigger/simulate into its own moduleDave Methvin2015-11-061-0/+2
| | | | | | | | Fixes gh-1864 Closes gh-2692 This also pulls the focusin/out special event into its own module, since that depends on simulate(). NB: The ajax module triggers events pretty heavily.
* Ajax: Only form-encode requests with a bodyDave Methvin2015-11-021-0/+6
| | | | | Fixes #2658 Closes #2671
* Ajax: improve content-type detectionOleg Gaidarenko2015-10-121-3/+3
| | | | | Fixes gh-2584 Closes gh-2643
* Ajax: Mitigate possible XSS vulnerabilityOleg Gaidarenko2015-10-121-1/+1
| | | | | | | Proposed by @jaubourg Fixes gh-2432 Closes gh-2588
* Ajax: do not quote "throws" option - use dot notation insteadOleg Gaidarenko2015-09-071-1/+1
| | | | | Fixes gh-2571 Closes gh-2542
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-26/+58
| | | | Fixes gh-2056
* Core: Switch from modules to just window.setTimeout etc.Michał Gołębiowski2015-06-171-6/+3
| | | | | | Using modules for window.setTimeout etc. made those functions cached and disabled Sinon mocking, making effects tests fail. Just writing window.setTimeout directly is smaller anyway.
* Core: Use window.setTimeout & friends instead of global equivalentsMichał Gołębiowski2015-06-171-1/+4
| | | | Fixes gh-2177
* Ajax: remove deprecated extensions from ajax promiseOleg Gaidarenko2015-02-171-6/+4
| | | | | Fixes gh-2084 Closes gh-2092
* Ajax: $.post and $.get can now take an options objectGeorge Mauer2015-01-111-2/+3
| | | | | Fixes gh-1986 Closes gh-1995
* Build: Don't assume the browser environment; smoke test on Node w/ jsdomMichał Gołębiowski2014-12-261-1/+3
| | | | | Fixes gh-1950 Closes gh-1949
* Ajax: use anchor tag for parsing urlsBen Toews2014-12-111-19/+26
| | | | | Fixes gh-1875 Closes gh-1880
* Ajax: Fix for request aborted in ajaxSendDan Hart2014-11-011-0/+6
| | | | | Fixes gh-1775 Close gh-1619
* Build: update grunt-jscs-checker and pass with the new rulesTimmy Willison2014-07-171-7/+16
|
* Ajax: Remove workaround for IE6/7Chris Antaki2014-07-131-19/+6
| | | | | Closes gh-1597 Ref #8138
* Support: clean up comments and Support notationDave Methvin2014-06-101-6/+5
| | | | Closes gh-1577
* Ajax: Support usage without jQuery.eventTJ VanToll2014-06-021-1/+2
| | | | | Fixes #15118 Closes gh-1588
* Ajax: move ajax event aliases to their own fileTimmy Willison2014-06-021-7/+0
| | | | Fixes #15126
* Fix #14036. Remove user/pass from ajaxLocation. Close gh-1340.njhamann2013-11-131-1/+1
|
* No ticket: fix code style inconsistencies. Closes gh-1361Oleg2013-09-131-5/+5
|