【问题标题】:How can I show the 'loading' pop up after I click on the submit button for jQuery Mobile?单击 jQuery Mobile 的提交按钮后,如何显示“加载”弹出窗口?
【发布时间】:2011-12-06 00:44:02
【问题描述】:

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

【问题讨论】:

    标签: jquery html forms dom jquery-mobile


    【解决方案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();

    【讨论】:

    • 是否有回调来检查提交是否完成,以便我知道何时可以调用'$.mobile.hidePageLoadingMsg();'?
    • 是的,我通过 ajax 提交。
    • 然后使用您的 AJAX 回调! $.post(url, data, function(){ $.mobile.hidePageLoadingMsg(); });
    • 已弃用,至少在 jqm 1.3.2 中,可能更早。查看代码显示 showPageLoadingMsg: function( theme, msgText, textonly ) { $.mobile.loading( 'show', theme, msgText, textonly ); },
    猜你喜欢
    • 1970-01-01
    • 2019-10-13
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多