X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=jquery%2Fjquery.js;h=c24e7949ea5887b469a2b42520d6ac91e4f606b7;hb=f197c7469f43c02bcbc65f2f41e2b419f0379700;hp=419b6e135de58aa8def6c9db1e47ea9d36694025;hpb=0027439156fb97bef30f6084d85898ec5b16155f;p=jquery.git diff --git a/jquery/jquery.js b/jquery/jquery.js index 419b6e1..c24e794 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -110,11 +110,12 @@ jQuery.fn = jQuery.prototype = { text: function(e) { e = e || this.get(); var t = ""; - for ( var j = 0; j < e.length; j++ ) - for ( var i = 0; i < e[j].childNodes.length; i++ ) - t += e[j].childNodes[i].nodeType != 1 ? - e[j].childNodes[i].nodeValue : - jQuery.fn.text(e[j].childNodes[i].childNodes); + for ( var j = 0; j < e.length; j++ ) { + var r = e[j].childNodes; + for ( var i = 0; i < r.length; i++ ) + t += r[i].nodeType != 1 ? + r[i].nodeValue : jQuery.fn.text([ r[i] ]); + } return t; }, @@ -172,8 +173,9 @@ jQuery.fn = jQuery.prototype = { }); }, remove: function() { - this.each(function(){this.parentNode.removeChild( this );}); - return this.pushStack( [] ); + return this.each(function(){ + this.parentNode.removeChild( this ); + }); }, wrap: function() { @@ -270,7 +272,7 @@ jQuery.fn = jQuery.prototype = { }, parent: function(a) { - var ret = jQuery.map(this.cur,"d.parentNode"); + var ret = jQuery.map(this.cur,"a.parentNode"); if ( a ) ret = jQuery.filter(a,ret).r; return this.pushStack(ret); }, @@ -751,7 +753,7 @@ jQuery.map = function(a,f) { var r = []; for ( var i = 0; i < a.length; i++ ) { var t = f(a[i],i); - if ( t !== null ) { + if ( t !== null && t != undefined ) { if ( t.constructor != Array ) t = [t]; r = jQuery.merge( t, r ); }