Show Page Loading Spinner on Ajax Call in jQuery Mobile

后端 未结 8 1904
说谎
说谎 2020-11-29 23:42

I\'m using $.ajax() to populate a list in my mobile web app. What I\'d like to do is have the jQuery mobile loading spinner appears while this call is being performed and di

8条回答
  •  庸人自扰
    2020-11-30 00:17

    You should do $.mobile.showPageLoadingMsg() just before the ajax call, and $.mobile.hidePageLoadingMsg() in the success (or fail) block so it goes away once a result comes back.

    I've never used jQuery mobile, but it should operate the same as showing/hiding a regular ol' spinning image.

提交回复
热议问题