Adds support for username and password to $.ajax
[jquery.git] / src / core.js
index 4decf3e..b5a1c70 100644 (file)
@@ -323,6 +323,8 @@ jQuery.fn = jQuery.prototype = {
                // Copy the events from the original to the clone
                if ( events === true )
                        this.find("*").andSelf().each(function(i){
+                               if (this.nodeType == 3)
+                                       return;
                                var events = jQuery.data( this, "events" );
 
                                for ( var type in events )
@@ -419,6 +421,7 @@ jQuery.fn = jQuery.prototype = {
 
                        }
 
+                       return undefined;
                }
 
                return this.each(function(){
@@ -497,7 +500,7 @@ jQuery.fn = jQuery.prototype = {
 
                        jQuery.each(elems, function(){
                                var elem = clone ?
-                                       this.cloneNode( true ) :
+                                       jQuery( this ).clone( true )[0] :
                                        this;
 
                                // execute all scripts after the elements have been injected
@@ -797,7 +800,7 @@ jQuery.extend({
                        else
                                jQuery.swap( elem, props, getWH );
                        
-                       return val;
+                       return Math.max(0, val);
                }
                
                return jQuery.curCSS( elem, name, force );
@@ -931,7 +934,7 @@ jQuery.extend({
                        if ( typeof elem == "string" ) {
                                // Fix "XHTML"-style tags in all browsers
                                elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
-                                       return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ?
+                                       return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
                                                all :
                                                front + "></" + tag + ">";
                                });