#10246 closed bug (worksforme)
Delegate function doesn't work with selector containing “^” in ie6-7
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | selector | Version: | 1.6.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$('body').delegate('a[href="#+"]','click',function(e){ e.preventDefault(); alert(123) });
But it works in another browser. Yet, IE still working until content update
Change History (3)
comment:1 follow-up: 2 Changed 11 years ago by
Component: | unfiled → selector |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
comment:2 Changed 11 years ago by
Replying to timmywil:
Works for me. http://jsfiddle.net/timmywil/QYCzC/ Keep in mind the + does nothing except check for the + character in the href.
That example is not very good, because cloning event handlers making delegate function useless. Here http://jsfiddle.net/QYCzC/7/ I recreated my situation and bug is present.
comment:3 Changed 11 years ago by
No, events are not copied by default. The event delegation still applies. The issue is not jQuery events or even selections. You are using the starts-with selector and IE6/7 edit anchor hrefs in place to include the domain. There's nothing we can do about that so I suggest using a more broad selector.
Works for me. http://jsfiddle.net/timmywil/QYCzC/ Keep in mind the + does nothing except check for the + character in the href.