#10928 closed bug (invalid)
$(window).on() breaks in IE
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I've got a set of code that uses the new .on()
, which I'd like to bind to the window
. However, the event fails to trigger in < IE9. Example code:
This works just fine in IE
$('body').on('click', '.class', function(e){ //this really should be window instead of 'body', but IE would break // do stuff }
This only works in FF, webkit:
$(window).on('click', '.class', function(e){ // do stuff }
Change History (5)
comment:1 Changed 12 years ago by
Owner: | set to Joey Baker <joey@…> |
---|---|
Status: | new → pending |
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 11 years ago by
I ran into the same issue using IE10 in Compatibility View / Document Mode: IE7 Standards.
Did not work:
$(window).on('click', '.class', function () { ( ... )
Does work:
$('body').on('click', '.class', function () { ( ... )
comment:5 Changed 11 years ago by
And again, to be clear, using $(window)
for delegated events is wrong and was never supported.
Why do you want to bind a delegated event to
window
? Read the description of event delegation in the API docs for .on(), it doesn't make sense to do that.