Ticket #11717 (closed bug: fixed)
Deprecate ajax "global" event behavior
| Reported by: | dmethvin | Owned by: | dmethvin |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.8 |
| Component: | event | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Currently the ajax events are "global" events in that they will fire on any element, e.g., $(".anything").ajaxStart(fn). The element doesn't even need to be attached to the DOM! This requires us to do some expensive bookkeeping and special-case code.
As of jQuery 1.8, the docs should encourage users to attach ajax events only to document. In 1.9 we can have them only fire on document, with a plugin for backcompat.
Change History
comment:1 Changed 13 months ago by dmethvin
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to event
- Milestone changed from None to 1.8
comment:2 Changed 13 months ago by dmethvin
- Owner set to dmethvin
- Status changed from open to assigned
Although the ajax events are the only ones in the public API to be global events, the event subsystem allows any caller to trigger a global event by passing a null to jQuery.event.trigger (which isn't a public API). So this is deprecating both some ajax behavior and an internal event feature.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
