Yep, option "0" was that one:

0 - $('#mySelect option:selected').text()

but I do not expect better performances except those browsers with
querySelectorAll enabled :/ still a good suggestion though

On Mon, Sep 21, 2009 at 5:00 PM, Samer Ziadeh <samerzia...@gmail.com> wrote:

> How does it perform if you remove the .find(), so you get $('#mySelect
> option:selected').text()
>
>
> On 2009-09-21, at 10:50 AM, matthew_maxwell wrote:
>
>
> I've been using jQuery for a little bit now, and have noticed that
> whenever you are attempting to use jQuery on selects with a large
> amount of options, it adds a few seconds of lag to the operation.
>
> An example I ran into was when I had a select of about 4,000 options
> or so (one for every user of my site), and wanted to use jQuery to
> change from a select to a plain text field, using the following:
>
> $("#user").html( $("#mySelect").find("option:selected").text() );
>
> The time from when the user initiates the change until it actually
> completes is about 1 or 2 seconds.
>
> I notice there's also a delay when it goes to add the select back:
>
> $("#user").html(
>    $( myApp.Selects.Users.HTML ).change(
>        function () {
>                $("#user").html( $("#mySelect").find
> ("option:selected").text() );
>        }
>    )
> );
>
> The lag time also appears when I go to do a simple remove:
> $("#mySelect").remove();
>
> When I use the DOM equivalents, though, this works almost instantly.
>
> Just figured I'd give you a heads up.
>
> No other issues, though.  Solid library.  Good work.
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to