>Yes, I figured it had to do with the type of variable it was and you
>are correct, that worked.  However, it still doesn't make sense to me
>that it would work for .html() but not for .text().  Why would the two
>operate differently?  It just seems inconsistent to me.

I agree. You should file a bug.

Here's the source:

        text: function(e) {
                if ( typeof e == "string" )
                        return this.empty().append( document.createTextNode(
e ) );

                var t = "";
                jQuery.each( e || this, function(){
                        jQuery.each( this.childNodes, function(){
                                if ( this.nodeType != 8 )
                                        t += this.nodeType != 1 ?
                                                this.nodeValue :
jQuery.fn.text([ this ]);
                        });
                });
                return t;
        },

The logic is assuming the only simple type value would be a string.

-Dan

Reply via email to