Sha256: d33a70be50fed0b534d976add9f4b45fdd3c7c49edf6ce9aa89ccdc5f564ad6a

Contents?: true

Size: 1.13 KB

Versions: 41

Compression:

Stored size: 1.13 KB

Contents

define( [
	"../var/document"
], function( document ) {
	"use strict";

	var preservedScriptAttributes = {
		type: true,
		src: true,
		nonce: true,
		noModule: true
	};

	function DOMEval( code, node, doc ) {
		doc = doc || document;

		var i, val,
			script = doc.createElement( "script" );

		script.text = code;
		if ( node ) {
			for ( i in preservedScriptAttributes ) {

				// Support: Firefox 64+, Edge 18+
				// Some browsers don't support the "nonce" property on scripts.
				// On the other hand, just using `getAttribute` is not enough as
				// the `nonce` attribute is reset to an empty string whenever it
				// becomes browsing-context connected.
				// See https://github.com/whatwg/html/issues/2369
				// See https://html.spec.whatwg.org/#nonce-attributes
				// The `node.getAttribute` check was added for the sake of
				// `jQuery.globalEval` so that it can fake a nonce-containing node
				// via an object.
				val = node[ i ] || node.getAttribute && node.getAttribute( i );
				if ( val ) {
					script.setAttribute( i, val );
				}
			}
		}
		doc.head.appendChild( script ).parentNode.removeChild( script );
	}

	return DOMEval;
} );

Version data entries

41 entries across 32 versions & 6 rubygems

Version Path
trusty-cms-6.3.1 node_modules/jquery-treetable/node_modules/jquery/src/core/DOMEval.js
trusty-cms-6.3.1 node_modules/jquery/src/core/DOMEval.js
trusty-cms-6.3.1 node_modules/jquery-ujs/node_modules/jquery/src/core/DOMEval.js
optimacms-0.1.61 spec/dummy/node_modules/cocoon-js/node_modules/jquery/src/core/DOMEval.js
optimacms-0.1.61 spec/dummy/node_modules/jquery-ujs/node_modules/jquery/src/core/DOMEval.js
udt-itf-theme-0.1.0 _sass/node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.7 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.6 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.5 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.4 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.3 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.2 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.1 node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.5 node_modules/jquery/src/core/DOMEval.js
trusty-cms-5.0.0 node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.4 node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.4 spec/dummy/node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.3 spec/dummy/node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.3 node_modules/jquery/src/core/DOMEval.js
trusty-cms-4.3.2 spec/dummy/node_modules/jquery/src/core/DOMEval.js