aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2019-01-21 18:34:40 +0100
committerGitHub <noreply@github.com>2019-01-21 18:34:40 +0100
commite4de8b4626f8872a4cb1ee241b60902653567503 (patch)
treeb5a7707bc09e0198cfff9b9919a0a1e4fb7a5370 /src
parent543d3d24eaefe09c4012171f30267783d51602dc (diff)
downloadjquery-e4de8b4626f8872a4cb1ee241b60902653567503.tar.gz
jquery-e4de8b4626f8872a4cb1ee241b60902653567503.zip
Manipulation: Respect script nomodule attribute in DOM manipulation
PR #3869 added support for `<script type="module">` & some support for the `nomodule` attribute but with no tests for `nomodule` and with the attribute only respected on inline scripts. This commit adds support for source-based scripts as well. It also adds tests for `nomodule`, including making sure legacy browsers execute such scripts as they'd natively do - that's the whole point of `nomodule` scripts, after all. Fixes gh-4281 Closes gh-4282 Ref gh-3871 Ref gh-3869
Diffstat (limited to 'src')
-rw-r--r--src/manipulation.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index a0e93f7ef..042728573 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -198,7 +198,7 @@ function domManip( collection, args, callback, ignored ) {
if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
// Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl ) {
+ if ( jQuery._evalUrl && !node.noModule ) {
jQuery._evalUrl( node.src );
}
} else {