Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Bug fix for commit 2c4b208 - technique wasn't working as expected in …
…WebKit browsers. Thanks to @jitter for the bug fix.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -164,7 +164,7 @@ jQuery.fn.extend({ | ||
var option = options[ i ]; | ||
|
||
// Don't return options that are disabled or in a disabled optgroup | ||
if ( option.selected && !option.disabled && | ||
if ( option.selected && option.getAttribute("disabled") === null && | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jeresig
Author
Member
|
||
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { | ||
// Get the specific value for the option | ||
value = jQuery(option).val(); | ||
This change fixes the problem for the Webkit browsers but breaks badly in all IE versions as IE doesn't adhere to the specification of
getAttribute
and returns aboolean
value for attributes where the value evaluates to aboolean
value (asdisabled
,checked
) instead of a string.Check this site for more info. http://reference.sitepoint.com/javascript/Element/getAttribute This is why originally I wanted to add to my previous note the warning that using
getAttribute
is risky as it is so broken across browsers