| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR gh-5197 started treating all non-string non-plain-object
`data` values as binary. However, `jQuery.ajax` also supports
arrays as values of `data`. This change makes regular arrays
no longer be considered binary data.
Surprisingly, we had no tests for array `data` values; otherwise,
we'd detect the issue earlier. This change also adds
a few such missing tests.
Closes gh-5203
Ref gh-5197
|
|
|
|
|
|
|
|
|
|
| |
The way gh-5197 implemented binary data handling, `processData`
was being explicitly set to `false`. This is expected but it made
it impossible to override it to `true`. The new logic will only
set `processData` to `false` if it wasn't explicitly passed
in original options.
Closes gh-5205
Ref gh-5197
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The AJAX script transport has two versions: XHR + `jQuery.globalEval` or
appending a script tag (note that `jQuery.globalEval` also appends a
script tag now, but inline). The former cannot support the `headers`
option which has so far not been taken into account.
For jQuery 3.x, the main consequence was the option not being respected
for cross-domain requests. Since in 4.x we use the latter way more
often, the option was being ignored in more cases.
The transport now checks whether the `headers` option is specified and
uses the XHR way unless `scriptAttrs` are specified as well.
Fixes gh-5142
Closes gh-5193
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR gh-2588 made jQuery stop auto-execute cross-domain scripts unless
`dataType: "script"` was explicitly provided; this change landed in jQuery
3.0.0. This change extends that logic same-domain scripts as well.
After this change, to request a script under a provided URL to be evaluated,
you need to provide `dataType: "script` in `jQuery.ajax` options or to use
`jQuery.getScript`.
Fixes gh-4822
Closes gh-4825
Ref gh-2432
Ref gh-2588
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't use a script tag for JSONP requests unless for cross-domain requests
or if scriptAttrs are provided. This makes the `responseJSON` property available
in JSONP error callbacks.
This fixes a regression from jQuery 3.5.0 introduced in gh-4379 which made
erroneous script responses to not be executed to follow native behavior.
The 3.x-stable branch doesn't need this fix as it doesn't use script tags for
regular async requests.
Closes gh-4778
Ref gh-4771
Ref gh-4773
Ref gh-4379
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, the AJAX script transport only used a script tag to load scripts
for cross-domain requests or ones with `scriptAttrs` set. This commit makes
it also used for all async requests to avoid CSP errors arising from usage
of inline scripts. This also makes `jQuery.getScript` not trigger CSP errors
as it uses the AJAX script transport under the hood.
For sync requests such a change is impossible and that's what `jQuery._evalUrl`
uses. Fixing that is tracked in gh-1895.
The commit also makes other type of requests using the script tag version of the
script transport set its type to "GET", namely async scripts & ones with
`scriptAttrs` set in addition to the existing cross-domain ones.
Fixes gh-3969
Closes gh-4763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, `jQuery.ajax` with `dataType: 'json'` with a provided callback was
automatically converted to a jsonp request unless one also specified
`jsonp: false`. Today the preferred way of interacting with a cross-domain
backend is CORS which works in all browsers jQuery 4 will support.
Auto-promoting JSON requests to JSONP ones introduces a security issue as the
developer may be unaware they're not just downloading data but executing code
from a remote domain.
This commit disables the auto-promoting logic.
BREAKING CHANGE: to trigger a JSONP request, it's now required to specify
`dataType: "jsonp"`; previously some requests with `dataType: "json"` were
auto-promoted to JSONP.
Fixes gh-1799
Fixes gh-3376
Closes gh-4754
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
Fixes gh-3028
Ref gh-2612
Useful, for example, to add `nonce`, `integrity`, or `crossorigin`.
|
|
|
|
| |
Fixes gh-3609
|
|
|
|
|
| |
Fixes gh-2959
Close gh-3884
|
|
|
|
|
| |
Fixes gh-3586
Close gh-3590
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
Fixes gh-3073
|
|
|
|
|
|
|
| |
Thanks @blq (Fredrik Blomqvist)
Fixes gh-3035
Close gh-3039
|
|
|
|
|
| |
The changes follow the spec proposed in:
https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Fixes gh-2800
Closes gh-2948
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
- IE9 does not have onabort. Use onreadystatechange instead.
Fixes gh-2079
Close gh-2684
|
|
|
|
|
| |
Fixes gh-2584
Closes gh-2643
|
|
|
|
|
|
| |
As noted by @arthurvr
Follow-up for b078a62013782c7424a4a61a240c23c4c0b42614
|
|
|
|
|
|
|
| |
Proposed by @jaubourg
Fixes gh-2432
Closes gh-2588
|
|
|
|
|
|
|
|
| |
Drop non-critical workarounds for Android 2.3.
Fixes gh-2483
Fixes gh-2505
Closes gh-2581
|
|
|
|
| |
Fixes gh-2056
|
|
|
|
|
| |
Fixes gh-2323
Closes gh-2464
|
|
|
|
|
|
| |
Refs 0705be475092aede1eddae01319ec931fb9c65fc
Refs gh-2287
Closes gh-2362
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Closes gh-2233
|
|
|
|
| |
Ref gh-2090
|
|
|
|
|
|
|
|
|
| |
Since it was deprecated since 1.8.
Also add additional comments which explains tricky
behaviour of "always" callback
Closes gh-2033
|
|
|
|
|
|
|
|
| |
* Move "evalScript.php" file to appropriate place
* Make jQuery#load "type" field explicit and add test for it
Ref trac-11264
|
|
|
|
|
|
|
| |
* Remove "async = true" from script transport since it was needed
for FF < 4 and old Opera which we do not support anymore
* Add comment to "evalUrl" method on why "type" field should be explicit
|
|
|
|
|
|
|
|
| |
not present: `< 0`
present: `> -1`
at index: `=== N`
Closes gh-1984
|
|
|
|
|
| |
Fixes gh-1950
Closes gh-1949
|
|
|
|
|
|
|
|
|
| |
-2 bytes to the gzipped size and code looks a bit nicer
This wasn't landed to the compat branch though, since size would increase
with this cherry-pick
Closes gh-1856
|
|
|
|
| |
Closes gh-1695
|
| |
|
|
|
|
| |
Fixes #14773
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This reverts commit 498e0e6c9bf486a0b1f16b455d65fcbc6c43867e.
We can't use the ActiveX XHR because it doesn't support events.
|