Bug Tracker

Opened 3 years ago

Closed 3 years ago

#12122 closed bug (fixed)

jQuery.ajax() async deprecate use with $.Deferred

Reported by: szimonek@… Owned by:
Priority: low Milestone: 1.8
Component: ajax Version: 1.8b2
Keywords: Cc:
Blocked by: Blocking:



In documentation on jQuery.ajax() async parameter there is: "As of jQuery 1.8, the use of async: false is deprecated." I need to argue with that. This deprecation will make my application unusable.

I'm using ZeroClipboard jQuery plugin called jquery.zclip.js to copy texts to clipboard. But the text to copy is SYNCHRONOUSLY retrieved from server before copy operation. I'm using $.ajax() call in beforeCopy zclip event, and it must be synchronous, otherwise zclip will copy to clipboard previous or none value. There is no other way (at least I don't know any) to do this.

My code (please look at beforeCopy event - that ajax call must finish and execute done() event, before copy event will be fired):

var container;

function putZeroClipboard(){

container = "";


async: false, global: false, type: "POST", url: "getso.jsp", data: { uuid: $("#so-uuid").text() }, timeout: 2000



path: "/resources/swf/ZeroClipboard.swf",

copy: function(){

return container;


beforeCopy: function(){


Populate variable. if (content.toString().length > 0){

container = content;

} else {

container = "\n";






The problem is, that all event in ZeroClipboard and zclip (beforeCopy, copy, afterCopy), are fired from flash action script. So if value to copy to clipboard is prepared in event beforeCopy, it must already be prepared when beforeCopy event ends, and that is only possible when using synchronous AJAX call.

Best regards Simon

Change History (1)

comment:1 Changed 3 years ago by dmethvin

  • Component changed from unfiled to ajax
  • Milestone changed from None to 1.8
  • Priority changed from undecided to low
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from jQuery.ajax() async deprecation. to jQuery.ajax() async deprecate use with $.Deferred

Documentation updated to clarify that async: false is still allowed but that use with $.Deferred is deprecated. The use shown above with callbacks is not deprecated.

Note: See TracTickets for help on using tickets.