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 { diff --git a/test/data/inner_nomodule.js b/test/data/inner_nomodule.js new file mode 100644 index 000000000..472f9d6b1 --- /dev/null +++ b/test/data/inner_nomodule.js @@ -0,0 +1 @@ +window.ok( !QUnit.moduleTypeSupported, "evaluated: inner nomodule script with src" ); diff --git a/test/data/nomodule.js b/test/data/nomodule.js new file mode 100644 index 000000000..fd26ea4e0 --- /dev/null +++ b/test/data/nomodule.js @@ -0,0 +1 @@ +window.ok( !QUnit.moduleTypeSupported, "evaluated: nomodule script with src" ); diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 672f397ad..7f30ddf25 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1798,7 +1798,7 @@ QUnit.test( "html(Function)", function( assert ) { } ); QUnit[ - // Support: Edge 16-17 + // Support: Edge 16-18+ // Edge sometimes doesn't execute module scripts so skip the test there. ( QUnit.moduleTypeSupported && !/edge\//i.test( navigator.userAgent ) ) ? "test" : @@ -1825,6 +1825,36 @@ QUnit[ }, 1000 ); } ); +QUnit[ + // Support: IE 9-11 only, Android 4.0-4.4 only, iOS 7-10 only + // `nomodule` scripts should be executed by legacy browsers only. + // iOS 10 supports `", + "", + "