Bug Tracker

Opened 11 years ago

Closed 11 years ago

#10888 closed enhancement (plugin)

jQuery should allow catching a namespaced event

Reported by: Marc-André Lafortune <[email protected]…> Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

Currently, the following won't do anything:

$(document).on("ajax", function(){ console.log("Ajax event!") })

$(document).trigger("ajax.success");

It would be nice if binding on "ajax" (or alternatively "ajax.*") would be understood as binding to all "ajax" events, even namespaced ones (like "ajax.success", "ajax.failure", for example).

Thanks

Change History (1)

comment:1 Changed 11 years ago by dmethvin

Resolution: plugin
Status: newclosed

You're welcome to create your own aliases if you'd like:

$(document).ajaxSuccess(function(){
  $(this).trigger("ajax.success");
});
... etc ...

A plugin like that would be great! You can evangelize that usage. It's not something we can justify in core though.

Note: See TracTickets for help on using tickets.