Bug Tracker

Opened 9 years ago

Last modified 9 years ago

#9347 closed enhancement

$.load don't inherit from $.ajax — at Version 10

Reported by: adrien.dupuis@… Owned by:
Priority: low Milestone: 1.7
Component: ajax Version: 1.6.1
Keywords: Cc: jaubourg
Blocked by: Blocking:

Description (last modified by Rick Waldron)

The $.load() function return this. The $.ajax() request build inside the $.load() can't be accessed for, as example, .abort(). By changing

  • jQuery.ajax({

+ return jQuery.ajax({

  • return this;

$.load could be a true $.ajax shorthand.

Change History (10)

comment:1 Changed 9 years ago by adrien.dupuis@…

I mean minus signs, not bullets (diff patch style).

comment:2 Changed 9 years ago by timmywil

Component: unfiledajax
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

load is different in that it is not $.load, but $.fn.load. Generally, functions on the prototype should return the current jQuery instance.

comment:3 Changed 9 years ago by ajpiano

I'm sort of inclined to agree with the OP that there should be some way to access the Deferred associated with a given $.fn.load call - perhaps something similar to how we are able to do so for animations now?

comment:4 Changed 9 years ago by timmywil

Resolution: wontfix
Status: closedreopened

comment:5 Changed 9 years ago by timmywil

Cc: jaubourg added
Status: reopenedopen

comment:6 Changed 9 years ago by dmethvin

This seems like an exceptional case, if it can't be done with one line of code or less I'd prefer we just let people use their own wrapper around $.ajax. #nobloat

comment:7 Changed 9 years ago by jaubourg

I thought about it back when I was working on fn.promise. Fact is you can do element.promise( "someCategory" ). For instance, by default element.promise() is equivalent to element.promise( "fx" ). It's just a question of adding the _mark/_unmark calls where needed.

Dunno if it's that useful though... should we tag this as an 1.7 enhancement proposal?

comment:8 Changed 9 years ago by timmywil

Perhaps something like


I think I would like that.

comment:9 Changed 9 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:10 Changed 9 years ago by Rick Waldron

Description: modified (diff)


Note: See TracTickets for help on using tickets.