Sha256: c2875443f9feccca528993eb11f55276362614fcedba007f7d9df2ca0efe69ea

Contents?: true

Size: 1.57 KB

Versions: 210

Compression:

Stored size: 1.57 KB

Contents

define( [
	"../core",
	"../var/document",
	"./var/rsingleTag",
	"../manipulation/buildFragment",

	// This is the only module that needs core/support
	"./support"
], function( jQuery, document, rsingleTag, buildFragment, support ) {

"use strict";

// Argument "data" should be string of html
// context (optional): If specified, the fragment will be created in this context,
// defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
jQuery.parseHTML = function( data, context, keepScripts ) {
	if ( typeof data !== "string" ) {
		return [];
	}
	if ( typeof context === "boolean" ) {
		keepScripts = context;
		context = false;
	}

	var base, parsed, scripts;

	if ( !context ) {

		// Stop scripts or inline event handlers from being executed immediately
		// by using document.implementation
		if ( support.createHTMLDocument ) {
			context = document.implementation.createHTMLDocument( "" );

			// Set the base href for the created document
			// so any parsed elements with URLs
			// are based on the document's URL (gh-2965)
			base = context.createElement( "base" );
			base.href = document.location.href;
			context.head.appendChild( base );
		} else {
			context = document;
		}
	}

	parsed = rsingleTag.exec( data );
	scripts = !keepScripts && [];

	// Single tag
	if ( parsed ) {
		return [ context.createElement( parsed[ 1 ] ) ];
	}

	parsed = buildFragment( [ data ], context, scripts );

	if ( scripts && scripts.length ) {
		jQuery( scripts ).remove();
	}

	return jQuery.merge( [], parsed.childNodes );
};

return jQuery.parseHTML;

} );

Version data entries

210 entries across 182 versions & 25 rubygems

Version Path
card-mod-bootstrap-0.18.1 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
trusty-cms-6.3.1 node_modules/jquery/src/core/parseHTML.js
trusty-cms-6.3.1 node_modules/jquery-treetable/node_modules/jquery/src/core/parseHTML.js
trusty-cms-6.3.1 node_modules/jquery-ujs/node_modules/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.18.0 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.17.0 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
optimacms-0.1.61 spec/dummy/node_modules/jquery-ujs/node_modules/jquery/src/core/parseHTML.js
optimacms-0.1.61 spec/dummy/node_modules/cocoon-js/node_modules/jquery/src/core/parseHTML.js
optimacms-0.1.61 spec/dummy/node_modules/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.16.0 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.6 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.5 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
udt-itf-theme-0.1.0 _sass/node_modules/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.4 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.3 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.1.2 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.2.pre1 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.1.1 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.1 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js
card-mod-bootstrap-0.15.0 vendor/bootswatch/docs/3/bower_components/jquery/src/core/parseHTML.js