0

AJAX リクエストの前に HTML ページ (jQuery Mobile) で$.mobile.loadingを使用しようとしていますが、機能していません (ユーザーがこのページに入力しても表示されません)。

これは私のソースコードです:

$(document).on('pagecreate', '#page_products', function(e){ 

    //Shows Loading Popup
    $.mobile.loading("show",{text: "Loading...", textVisible: true });

    $.ajax({
        url: URL,
        type: "GET",
        dataType: "JSONP",
        async: true,
        success: function(json, status){

            //source code for success response
            //[...]

                    //hide loading popup
            $.mobile.loading('hide');

            return true;
        },
        contentType: "text/xml; charset=\"utf-8\""
    });
});

ノート:

  1. $.mobile.loadingを ajax 成功応答内に配置すると、表示されました!
  2. pagebeforeshow でも試してみましたが、問題は同じです。

問題または別の解決策の提案は何ですか?

前もって感謝します。

4

2 に答える 2