var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
- rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&\w+;/,
jQuery.fn.extend({
text: function( text ) {
+ if(jQuery.isFunction(text)) {
+ return this.each(function() {
+ return jQuery(this).text( text.call(this) );
+ });
+ }
+
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
}
}).end();
},
-
+
append: function() {
return this.domManip(arguments, true, function(elem){
if ( this.nodeType === 1 ) {
var i = 0;
ret.each(function(){
- if ( this.nodeName !== orig[i].nodeName ) {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
return;
}