Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13873 closed bug (notabug)

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

Reported by: kofbossyagami@… 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/

Change History (3)

comment:1 Changed 7 years ago by dmethvin

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.

comment:2 Changed 7 years ago by anonymous

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

comment:3 Changed 7 years ago by dmethvin

Use a different namespace, for example.

Note: See TracTickets for help on using tickets.