单击jQuery Mobile的提交按钮后,如何显示“加载”?

时间:2011-10-12 10:40:46

标签: jquery html forms dom jquery-mobile

我正在使用jQuery Mobile javascript库。在我的形式中,我似乎无法实现form正在做的事情。点击“提交”按钮后。我希望用户看到弹出的“加载”。

1 个答案:

答案 0 :(得分:1)

项重要的

请注意Michael Kariv的以下评论:

  

已弃用,至少在jqm 1.3.2中,可能更早。调查代码揭示

showPageLoadingMsg: function( theme, msgText, textonly ) {
    $.mobile.loading('show', theme, msgText, textonly );
}

最初的答案是:


$('#yourform').submit(function(){
    $.mobile.showPageLoadingMsg(); // http://jquerymobile.com/test/docs/api/methods.html
})

再次隐藏邮件:$.mobile.hidePageLoadingMsg();