Skip to main content

Bug Tracker

Side navigation

#10888 closed enhancement (plugin)

Opened November 24, 2011 07:37PM UTC

Closed November 24, 2011 08:23PM UTC

jQuery should allow catching a namespaced event

Reported by: Marc-André Lafortune <jquery@marc-andre.ca> 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

Attachments (0)
Change History (1)

Changed November 24, 2011 08:23PM UTC by dmethvin comment:1

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.