#javascript #jquery #jquery-ui #jquery-plugins
Вопрос:
jQuery.parseHTML = function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts amp;amp; [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts amp;amp; scripts.length ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
};
Поскольку мы ссылаемся на один и тот же код в нашем приложении, amp; jquery.buildfragment устарел. Каков альтернативный способ работы этой функции? Ошибка построения фрагмента не является функцией