2011-12-28 31 views
0
<script type="text/javascript"> 
     $(document).ready(function() { 
      $("#sb").click(function() { 
      $.ajax({ 
        type: "POST", 
        contentType: "application/json; charset=utf-8", 
        data: "{ UserName: '" + $('#UN').val() + "',Password:'"+$('#Psd').val()+"'}", 
        url: "DbLogic.aspx/User_Authentication", 
        dataType: "json", 
        success: function(data) { 

        if(data.d==1) 
        { 
         $.mobile.loadingMessage = "Please wait..."; 
         $.mobile.pageLoading(); 
         $.mobile.showPageLoadingMsg(); 
         document.location.href="DbLogic.aspx"; 
        } 
        else 
        { 
         document.location.href="#"; 
        } 
        } // end of success 
       }); // end of ajax 
      }); //end of click call 
      });  // end of jquery call 
    </script> 

在上面的代碼我得到一個錯誤說「微軟JScript運行時錯誤:對象不支持此屬性或方法」。 執行$.mobile.pageLoading();時遇到錯誤。我也導入了jQuery/jQuery Mobile JavaScript。問題與腳本執行的移動應用

請告訴我我錯了什麼。

回答

0

那是因爲$.mobile.pageLoading();函數不存在?請參閱API http://jquerymobile.com/test/docs/api/methods.html

+0

好吧,我同意你的看法,這個時候,我取出$ .mobile.pageLoading ();聲明。這次錯誤指向$ .mobile.showPageLoadingMsg(); ** Microsoft JScript運行時錯誤:對象不支持此屬性或方法** – 2011-12-28 10:52:21

+0

我們可以看到您的一個HTML頁面的源? – Niels 2011-12-28 11:07:28

+0

我的意圖是顯示一個加載消息,直到使用jquery的新頁面在手機中加載。 如果你有任何樣品請分享。 – 2011-12-28 11:29:21