How to wait for response in $.post jQuery

前端 未结 1 1336
忘了有多久
忘了有多久 2021-01-12 16:08

PHP returns value with 1-2 second delay jQuery.post doesn\'t wait for response.

How do you think, is it possible to fix that problem and wait for response?

相关标签:
1条回答
  • 2021-01-12 16:33

    $.post is asynchronous, you need to use $.ajax and set async to false, that way you will be able to wait for the response. You can read more about it here: http://api.jquery.com/jQuery.ajax/

    0 讨论(0)
提交回复
热议问题