コードをコピー コードは次のとおりです:
var rnocache = /<(?:script|object|embed|option|style)/i,
rchecked = /checkeds*(?:[^=]|=s*.checked. )/i,
rnoshimcache = new RegExp("<(?:" nodeNames ")[\s/>]", "i");
jQuery.fragments = {};
jQuery .buildFragment = function( args, context, scripts ) {
var fragment, cacheable, cachehit,
first = args[ 0 ];
// Set context from what may come in as undefined or a jQuery collection or a node
// Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
// also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
/ / According to the different value of the parameter context, ensure that the context is the document root node document
// The code after jQuery 1.8.0 has been greatly improved compared to the previous version. The following are the improvements:
// For the context parameter value: undefined, jQuery object, DOM element node status improvement code
// Solve the bug in version 1.8.0 that the context parameter is a document fragment (#document-fragment)
context = context || document;
context = !context.nodeType && context[0] || context;
context = context.ownerDocument || context;
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put