Bug Tracker

Opened 8 years ago

Last modified 6 years ago

#11013 closed enhancement

Remove async option from $.ajax — at Version 9

Reported by: jaubourg Owned by:
Priority: low Milestone: 1.8
Component: ajax Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking: #10467

Description (last modified by Rick Waldron)

The async option will allow, if set to false, to make synchronous ajax requests.

It is the worst possible way to make ajax requests (it hangs the javascript VM), it also makes it impossible to implement Deferreds in a truly asynchronous fashion (because we cannot assume ajax is always asynchronous).

Sadly, this synchronous possibility is used internally in jQuery in order to execute script tags with src attributes in html fragments: https://github.com/jquery/jquery/blob/master/src/manipulation.js#L350

However this will not work for cross-domain, so I think we could very well "remove" this feature and document everything properly.

Change History (9)

comment:1 Changed 8 years ago by jaubourg

Component: unfiledajax
Description: modified (diff)
Keywords: 1.8-discuss added
Milestone: None1.8
Priority: undecidedlow

comment:2 Changed 8 years ago by jaubourg

Summary: Remove async options from $.ajaxRemove async option from $.ajax

comment:3 Changed 8 years ago by jaubourg

Blocking: 10467 added

comment:4 Changed 8 years ago by jaubourg

Description: modified (diff)

+1

comment:5 Changed 8 years ago by dmethvin

Description: modified (diff)

+1, Deprecate yes, remove no (at least not any time soon). People might think twice about using a deprecated feature which is our goal here.

comment:6 in reply to:  5 Changed 8 years ago by jaubourg

Replying to dmethvin:

+1, Deprecate yes, remove no (at least not any time soon). People might think twice about using a deprecated feature which is our goal here.

No, the goal would be to remove the option so that we are sure to only have asynchronous ajax requests. Deprecating sadly won't solve any problem.

comment:7 Changed 8 years ago by dmethvin

Status: newopen

comment:8 Changed 8 years ago by timmywil

Description: modified (diff)

-1, I agree it's bad, but unfortunately used far too often

comment:9 Changed 8 years ago by Rick Waldron

Description: modified (diff)

-1

Note: See TracTickets for help on using tickets.