On Dec 22, 1:05 am, John Resig <[email protected]> wrote:
> Just to clarify then, since jQuery already covers cases 2-4 as you're
> expecting it to and case #1 currently fails - and that case is
> decidedly not what this thread discussion started as.
I'm just pointing out several test cases that should be handled
correctly, possibly added to the test suite.
> > <select id="x">
> > <option value="1">Dummy</option>
> > <option value="">Empty</option>
> > </select>
> > $('#x').val('')
> > should select the second option.
> Agreed.
Broken in 1.4.1a2, but now corrected I see.
> > <select id="x">
> > <option value="x">z</option>
> > <option value="y">x</option>
> > </select>
> > $('#x').val('x')
> > should select the first option only.
> Yep, as it does in 1.4.
Yes, but it didn't in 1.3.2.
> > <select multiple id="x">
> > <option value="x">z</option>
> > <option value="y">x</option>
> > </select>
> > $('#x').val('x')
> > should select the first option only, IMO. It's kind of ambiguous and
> > jQuery should define what it wants to do.
> Yep, as it does in 1.4.
Yes, but it didn't in 1.3.2.
> In fact, 1.4 removes the ambiguity completely
> by only using the value with the val method, which is much better.
I agree, but it is a change in the API and may make it difficult for
some to upgrade (it removes functionality). The wandering API
sometimes makes it difficult to upgrade jQuery versions, which is why
I have some projects stuck on 1.2.6 and one that was just recently
upped from 1.1.2! :(
Matt Kruse
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en.