Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10246 closed bug (worksforme)

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

Reported by: zi.white <[email protected]…> 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 Changed 10 years ago by timmywil

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.

comment:2 in reply to:  1 Changed 10 years ago by zi.white <[email protected]…>

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 10 years ago by timmywil

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.

Note: See TracTickets for help on using tickets.