How to invoke a “Please Wait” window only if ajax takes more than X milliseconds to respond?

后端 未结 4 1102
心在旅途
心在旅途 2020-12-07 06:18

I\'m doing an AJAX call (regular JS) and, if it takes more than, say, 500 milliseconds, I\'d like to put up my \"Please Wait\" box.

Normally, if I want to put up the

4条回答
  •  难免孤独
    2020-12-07 06:23

    take a look at BlockUi. If that doesn't look like it will work for you, you could try using

    $(document).ajaxStop(DoSomething()); 
    

提交回复
热议问题