comparison default/node_modules/jquery/src/core/DOMEval.js @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 define( [
2 "../var/document"
3 ], function( document ) {
4 "use strict";
5
6 var preservedScriptAttributes = {
7 type: true,
8 src: true,
9 noModule: true
10 };
11
12 function DOMEval( code, doc, node ) {
13 doc = doc || document;
14
15 var i,
16 script = doc.createElement( "script" );
17
18 script.text = code;
19 if ( node ) {
20 for ( i in preservedScriptAttributes ) {
21 if ( node[ i ] ) {
22 script[ i ] = node[ i ];
23 }
24 }
25 }
26 doc.head.appendChild( script ).parentNode.removeChild( script );
27 }
28
29 return DOMEval;
30 } );