jQuery ajax call with async false is not working

前端 未结 3 1543
被撕碎了的回忆
被撕碎了的回忆 2020-12-16 07:27

Here I have pasted my code, I want to return the response of $.ajax as response of function a(). But before the result comes up of ajax call, it is returning the empty f. pl

3条回答
  •  眼角桃花
    2020-12-16 07:58

    Unless you work for twitter, I would assume it is failing because "Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation."

    Deprecated != removed and even if it did I take the deprecation is in the context of the returned jqXHR which are not being used here.

    http://api.jquery.com/jQuery.ajax/

    It looks like @Murali provides a work-around, but the above is important to point out for those having issue with same-domain requests.

提交回复
热议问题