Skip to main content

Bug Tracker

Side navigation

#10246 closed bug (worksforme)

Opened September 10, 2011 05:36PM UTC

Closed September 10, 2011 05:50PM UTC

Last modified September 14, 2011 01:33PM UTC

Delegate function doesn't work with selector containing “^” in ie6-7

Reported by: zi.white <furway@ya.ru> 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

Attachments (0)
Change History (3)

Changed September 10, 2011 05:50PM UTC by timmywil comment:1

component: unfiledselector
priority: undecidedlow
resolution: → worksforme
status: newclosed

Works for me. http://jsfiddle.net/timmywil/QYCzC/ Keep in mind the + does nothing except check for the + character in the href.

Changed September 13, 2011 09:34PM UTC by zi.white <furway@ya.ru> comment:2

Replying to [comment:1 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.

Changed September 14, 2011 01:33PM UTC by timmywil comment:3

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.