How do I do a jQuery blocking AJAX call without async = false?

后端 未结 6 1710
梦毁少年i
梦毁少年i 2021-01-01 22:04

I have a page which does AJAX validation of an email before continuing on to the next page, using the HTML5 setCustomValidity() method [using the webshims library for older

6条回答
  •  梦谈多话
    2021-01-01 22:59

    http://bugs.jquery.com/ticket/11013#comment:40

    The use of the Deferred/Promise functionality in synchronous ajax requests has been deprecated in 1.8. The $.ajax method with async: false is supported but you must use a callback parameter rather than a Promise method such as .then or .done.

    So, if you are using the success/complete/error handlers, you can still use async:false. More info at the jquery ticket above.

提交回复
热议问题