Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Binding "change" on an select though .live() doesn't seem to work in IE using jQuery 1.4
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
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:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mape  
View profile  
 More options Jan 16 2010, 8:34 am
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
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alexander farkas  
View profile  
 More options Jan 17 2010, 9:48 am
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Hallström  
View profile  
 More options Jan 18 2010, 5:51 am
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Hallström  
View profile  
 More options Jan 18 2010, 9:05 am
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
matiasnu  
View profile  
 More options Jan 18 2010, 9:56 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alexander farkas  
View profile  
 More options Jan 18 2010, 5:42 pm
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
matiasnu  
View profile  
 More options Jan 19 2010, 5:52 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Resig  
View profile  
 More options Jan 19 2010, 9:12 am
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Hallström  
View profile  
 More options Jan 25 2010, 9:51 am
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Elias  
View profile  
 More options Jan 25 2010, 1:28 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Resig  
View profile  
 More options Jan 25 2010, 1:47 pm
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »