1

当 jquery-mobile 中的 ajax 为 false 时。为什么加载器图像在 android 默认浏览器中的表单提交时不起作用。我试过这段代码。

用于移动网站的我的 Jquery 代码

$(document).bind("mobileinit", function(){
    $.mobile.ajaxEnabled = false;
});


$("form").validate({
        rules: {
            phone: { required:true,minlength: 10, maxlength:10 },
            zip: { required:true,minlength: 5, maxlength:5 },
            first_name:{required:true,lettersonly:true,minlength: 2},
            address:{required:true,minlength: 2, maxlength:200},
            last_name:{required:true,lettersonly:true,minlength: 2},
            email:{required:true,email:true}
        },
        errorElement:'div',
        errorClass: "warning",

        submitHandler: function(){

            $.mobile.loading( 'show' );
            form.submit();

            }

    });
4

1 回答 1

0
Use this code for show loader
$.mobile.loadingMessageTextVisible = true;
$.mobile.showPageLoadingMsg("a", LOADING_MSG, false);


For Hide use this
$.mobile.hidePageLoadingMsg();



$.mobile.loading( "show", {
        text: msgText,
        textVisible: textVisible,
        theme: theme,
        textonly: textonly,
        html: html
});
Hide Msg
$.mobile.loading( "hide" );

`

于 2013-10-01T08:41:44.407 回答