Skip to main content

Bug Tracker

Side navigation

#13873 closed bug (notabug)

Opened May 09, 2013 11:06PM UTC

Closed May 10, 2013 12:41AM UTC

Last modified May 10, 2013 02:16AM UTC

Exclamation mark doesn't work in trigger() when using event namespace in jQuery 1.9

Reported by: kofbossyagami@qq.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Here is the code:

$("div").on("click",function(){
       console.log("click");
});
$("div").on("click.plugin", function(){
       console.log("click.plugin");
});
$("button").click(function() {
      $("div").trigger("click!");    
});

and the HTML:

<div>test.</div>
<button >Trigger event according to namespace</button>

When I [run the code under jQuery 1.8.3][1], it works. When I click button, it logs click in the console.

But when I [change to jQuery 1.9.1][2], nothing happens when I press the button. It seems like the exclamation mark doesn't work anymore in 1.9.1.

I can't find this change in the 1.9 upgrade guide. Does anybody know why?

[1]: http://jsfiddle.net/un9aP/

[2]: http://jsfiddle.net/un9aP/1/

Attachments (0)
Change History (3)

Changed May 10, 2013 12:41AM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

Those were called "exclusive events" but were never documented. They were removed in jQuery 1.9. I can add it to the upgrade guide but since they were never documented we didn't expect that anyone used them.

Changed May 10, 2013 02:05AM UTC by anonymous comment:2

If it is the case, how to trigger exclusive events now?

Changed May 10, 2013 02:16AM UTC by dmethvin comment:3

Use a different namespace, for example.