Skip to main content

Bug Tracker

Side navigation

#4994 closed feature (worksforme)

Opened July 29, 2009 10:29PM UTC

Closed November 22, 2010 06:16AM UTC

new ajax 'target' option upon which ajaxEvents are triggered, when specified

Reported by: nbubna Owned by: flesler
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: ajax events load trigger Cc: nbubna
Blocked by: Blocking:
Description

Supports a new 'target' option for $.ajax. When specified, all ajax events (ajaxStart and such) are triggered on that, instead of being globally triggered. For $.fn.load calls (and plugins that do similar things), this provides a means to identify the element upon which the ajax action is being done.

See:

http://groups.google.com/group/jquery-dev/browse_thread/thread/caf31f67a3ac159c

Attachments (2)
  • ajax.patch (5.0 KB) - added by flesler September 15, 2009 03:19PM UTC.
  • jquery4994.patch (2.2 KB) - added by nbubna July 29, 2009 10:44PM UTC.

    Suggested implementation

Change History (4)

Changed September 15, 2009 03:19PM UTC by flesler comment:1

cc: → nbubna
need: ReviewPatch
owner: → flesler
status: newassigned
type: enhancementfeature

Changed September 15, 2009 03:20PM UTC by flesler comment:2

resolution: → fixed
status: assignedclosed

Applied at [6563]

Changed October 08, 2010 03:00PM UTC by ngrilly comment:3

resolution: fixed
status: closedreopened

Function $(selector).load() was modified in changeset [6563] in order to use the DOM element as the context of the call to $.ajax.

Looking at jQuery most recent source code, it looks like this change was reverted:

http://github.com/jquery/jquery/blob/master/src/ajax.js#L56

Is there a reason for that?

Changed November 22, 2010 06:16AM UTC by snover comment:4

resolution: → worksforme
status: reopenedclosed

If you need a context for an operation, you have to do it manually through $.ajax. Automatic context change for the global events is never provided, consistently.