Javascript JQueryMobile注册vclick事件处理程序可防止defuault表单提交

Javascript JQueryMobile注册vclick事件处理程序可防止defuault表单提交,javascript,jquery,html,jquery-mobile,mobile,Javascript,Jquery,Html,Jquery Mobile,Mobile,我正在jquerymobile中的按钮和锚定标记上注册一个“vclick”事件处理程序 <script> $(document).bind("pageinit", function(event, ui) { $('.show-page-loading-msg').bind('vclick', function() { $.mobile.loadingMessage = "Loading...";// "Approved";

我正在jquerymobile中的按钮和锚定标记上注册一个“vclick”事件处理程序

    <script>
    $(document).bind("pageinit", function(event, ui) {
        $('.show-page-loading-msg').bind('vclick', function() {
            $.mobile.loadingMessage = "Loading...";// "Approved";
            $.mobile.textOnly = false;
            $.mobile.showPageLoadingMsg();

        });
    });
</script>

$(文档).bind(“pageinit”,函数(事件,用户界面){
$('.show page loading msg').bind('vclick',function(){
$.mobile.loadingMessage=“正在加载…”;//“已批准”;
$.mobile.textOnly=false;
$.mobile.showPageLoadingMsg();
});
});
现在,在大多数情况下,随机事件都可以正常工作,但有时,我看到的只是无限期地加载消息,没有提交提交按钮表单的默认功能,也没有为锚标记显示新的移动页面。请注意,有时它可以正常工作

标记:

<form id="test" data-ajax="false" action="/test/login" method="post">
    <!--username password textboxes here-->
            <input class="show-page-loading-msg ui-btn-hidden" type="submit" value="Sign In" data-theme="e">
            <a class="show-page-loading-msg" href="/test/home" data-role="button" data-theme="d">Cancel</a>     
    </form>


“随机提交”按钮不会提交表单,有时甚至锚定标记也不会显示在另一个页面上,但它们始终会显示加载消息。

无法说明这是否会消除问题,但在任何情况下:由于jQuery 1.7,因此不建议使用bind(),应替换为on()我正在使用jQuery V1.4.4和jQuery Mobile V1.0.1,也许你应该考虑升级——旧版本很可能会有一些bug,很多人甚至不知道,因为它们可能在很久以前就被固定了。至少尝试一下最新版本,看看你是否还能重现这个问题。至少我会这么做尝试删除
data Ajax=false
或坐到
true
尝试升级到:jquery-1.8.2和jquery.mobile-1.3.0,但没有运气..同样的问题。工作时间约为10次中的8次