Ajax: Don't auto-execute scripts unless dataType provided#4825
Merged
mgol merged 1 commit intojquery:masterfrom Jan 26, 2021
Merged
Ajax: Don't auto-execute scripts unless dataType provided#4825mgol merged 1 commit intojquery:masterfrom
mgol merged 1 commit intojquery:masterfrom
Conversation
b7445b2 to
ba781e1
Compare
PR jquerygh-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 jquerygh-4822 Ref jquerygh-2432 Ref jquerygh-2588
ba781e1 to
fe9ebf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ajax: Don't auto-execute scripts unless dataType provided
PR gh-2588 made jQuery stop auto-execute cross-domain scripts unless
dataType: "script"was explicitly provided; this change landed in jQuery3.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: "scriptinjQuery.ajaxoptions or to usejQuery.getScript.Fixes gh-4822
Ref gh-2432
Ref gh-2588
-28 bytes
Checklist
dataTypefor all script requests in 4.0 api.jquery.com#1258)