Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
mape <katapultstolpil... @gmail.com>
Date: Sat, 16 Jan 2010 05:34:00 -0800 (PST)
Subject: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
alexander farkas <a.farkas... @googlemail.com>
Date: Sun, 17 Jan 2010 06:48:10 -0800 (PST)
Local: Sun, Jan 17 2010 9:48 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
I have looked into this. The "trigger-line" in the testChange-function
has to be changed from this:
return jQuery.event.trigger( e, arguments[1], this );
to this:
return jQuery.event.trigger( e, arguments[1], elem );
Additional It seems, that there was a typo. The condition above contains the following statement:
elem.type !== "select"
wich is always true. I think this can be deleted, without problems.
On 16 Jan., 14:34, mape <katapultstolpil... @gmail.com> wrote:
> The example works fine in Firefox 3.6, Safari 4.0.4 and Chrome
> 4.0.295.0 dev.
> Doesn't seem to work in IE8 (native) and IE6, IE7 (though IEtester).
> http://mape.me/jquery/select-live-ie/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Mattias Hallström <matt... @problem.se>
Date: Mon, 18 Jan 2010 02:51:40 -0800 (PST)
Local: Mon, Jan 18 2010 5:51 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
We have the same problem, but found out that it works if we chain bind
and live like this:
this.bind("change", function(e){ // Do nothing }).live("change", function(e){
});
Not sure why though?!
//Mattias On 16 Jan, 14:34, mape <katapultstolpil... @gmail.com> wrote:
> The example works fine in Firefox 3.6, Safari 4.0.4 and Chrome
> 4.0.295.0 dev.
> Doesn't seem to work in IE8 (native) and IE6, IE7 (though IEtester).
> http://mape.me/jquery/select-live-ie/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Mattias Hallström <matt... @problem.se>
Date: Mon, 18 Jan 2010 06:05:27 -0800 (PST)
Local: Mon, Jan 18 2010 9:05 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
My misstake. It "almost works.
If we run this on a page where content doesn't come via ajax, it
doesn't work!
Also it's not enough just to run this.live() on "none ajax content" either, but when we chain bind and live it works.
//Mattias
On 18 Jan, 11:51, Mattias Hallström <matt... @problem.se> wrote:
> We have the same problem, but found out that it works if we chain bind
> and live like this:
> this.bind("change", function(e){ > // Do nothing > }).live("change", function(e){
> });
> Not sure why though?!
> //Mattias > On 16 Jan, 14:34, mape <katapultstolpil... @gmail.com> wrote:
> > The example works fine in Firefox 3.6, Safari 4.0.4 and Chrome > > 4.0.295.0 dev.
> > Doesn't seem to work in IE8 (native) and IE6, IE7 (though IEtester).
> >http://mape.me/jquery/select-live-ie/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
matiasnu <matia... @gmail.com>
Date: Mon, 18 Jan 2010 06:56:50 -0800 (PST)
Local: Mon, Jan 18 2010 9:56 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
alexander farkas <a.farkas... @googlemail.com>
Date: Mon, 18 Jan 2010 14:42:19 -0800 (PST)
Local: Mon, Jan 18 2010 5:42 pm
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
The bug happens due to the fact, that jQuery "cleans up the event in
case it is reused" in his trigger method (e.target = elem). If a
change is detected the current implementation calls trigger with the
element as the elem-argument for trigger. (with live: in most cases
the document/with bind: in most cases the select-element itself)
This means that the change-event is actually triggered on the document, but e.target references also the document-object, so that the closest-method can´t find a matching element and won´t call your event-handler.
This also explains why the strange behavior occurs if you additionally bind a change event directly to the select-element. The change is detected and the trigger function is invoked with the select-element as the elem-argument, so that it can be handled properly by live, too.
Additionally it explains, why this bug could pass the testsuite. change is testet here with both bind and live in one page at one time. This is really annoying, but it´s extremly hard to build a good testcase for the change-event and noone thought about such an interference.
The code explained above will fix this issue.
On 18 Jan., 11:51, Mattias Hallström <matt... @problem.se> wrote:
> We have the same problem, but found out that it works if we chain bind
> and live like this:
> this.bind("change", function(e){ > // Do nothing > }).live("change", function(e){
> });
> Not sure why though?!
> //Mattias > On 16 Jan, 14:34, mape <katapultstolpil... @gmail.com> wrote:
> > The example works fine in Firefox 3.6, Safari 4.0.4 and Chrome > > 4.0.295.0 dev.
> > Doesn't seem to work in IE8 (native) and IE6, IE7 (though IEtester).
> >http://mape.me/jquery/select-live-ie/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
matiasnu <matia... @gmail.com>
Date: Tue, 19 Jan 2010 02:52:43 -0800 (PST)
Local: Tues, Jan 19 2010 5:52 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
On Jan 18, 11:42 pm, alexander farkas <a.farkas
... @googlemail.com>
wrote:
> The code explained above will fix this issue.
Great, and John has now committed the fix. Let's hope 1.4.1 is not too
far away! ;)
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
John Resig <jere... @gmail.com>
Date: Tue, 19 Jan 2010 09:12:21 -0500
Local: Tues, Jan 19 2010 9:12 am
Subject: Re: [jquery-dev] Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
> Great, and John has now committed the fix. Let's hope 1.4.1 is not too > far away! ;)
It'll be out by Friday.
--John
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Mattias Hallström <matt... @problem.se>
Date: Mon, 25 Jan 2010 06:51:10 -0800 (PST)
Local: Mon, Jan 25 2010 9:51 am
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
Great news :-)
Thanks for the fix!
On 19 Jan, 11:52, matiasnu <matia... @gmail.com> wrote:
> On Jan 18, 11:42 pm, alexander farkas <a.farkas
... @googlemail.com>
> wrote:
> > The code explained above will fix this issue.
> Great, and John has now committed the fix. Let's hope 1.4.1 is not too > far away! ;)
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Elias <mikez... @gmail.com>
Date: Mon, 25 Jan 2010 10:28:36 -0800 (PST)
Local: Mon, Jan 25 2010 1:28 pm
Subject: Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
Is the fix released? If so, where can I get it from?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
John Resig <jere... @gmail.com>
Date: Mon, 25 Jan 2010 13:47:41 -0500
Local: Mon, Jan 25 2010 1:47 pm
Subject: Re: [jquery-dev] Re: Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
1.4.1 will be out today, you can get the fix at that time.
--John
On Mon, Jan 25, 2010 at 1:28 PM, Elias <mikez
... @gmail.com> wrote:
> Is the fix released? If so, where can I get it from?
> -- > 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+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en .
You must
Sign in before you can post messages.
You do not have the permission required to post.