X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=74fd6fcb3cdc8f18c095260fca6778caee92ac0a;hb=c66aa570299459ea948eb123a442da6e22a9611b;hp=6dd7111adbfe9a759261b88b1c04991bf8c9d928;hpb=96e4006b74d03319af86b9ed27f7235ee2f8fe6c;p=jquery.git diff --git a/src/core.js b/src/core.js index 6dd7111..74fd6fc 100644 --- a/src/core.js +++ b/src/core.js @@ -266,7 +266,7 @@ jQuery.fn = jQuery.prototype = { return jQuery.find( selector, elem ); }); - return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + return this.pushStack( /[^+>] [^+>]/.test( selector ) ? jQuery.unique( elems ) : elems ); }, @@ -362,6 +362,9 @@ jQuery.fn = jQuery.prototype = { if ( this.length ) { var elem = this[0]; + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, @@ -379,7 +382,7 @@ jQuery.fn = jQuery.prototype = { if ( option.selected ) { // Get the specifc value for the option - value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + value = jQuery(option).val(); // We don't need an array for one selects if ( one ) @@ -613,9 +616,10 @@ jQuery.extend({ }, // See test/unit/core.js for details concerning this function. + // Since 1.3 DOM methods and function like alert + // aren't supported. They return false on IE (#2968). isFunction: function( fn ) { - return !!fn && typeof fn != "string" && !fn.nodeName && - fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + return fn instanceof Function; }, // check if an element is in a (or is an) XML document @@ -1221,7 +1225,7 @@ var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], + version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], safari: /webkit/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), @@ -1309,7 +1313,7 @@ jQuery.each({ remove: function( selector ) { if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) { // Prevent memory leaks - jQuery( "*", this ).add(this).each(function(){ + jQuery( "*", this ).add([this]).each(function(){ jQuery.event.remove(this); jQuery.removeData(this); });