2012-02-07 33 views
4

我想調試我的phonegap應用程序。當我嘗試在我的模擬器上打開我的應用程序時,出現錯誤,提示我使用phonegap構建,因此我沒有任何本機代碼。奇怪的是我只加載本地資源,所以我不明白爲什麼我會得到一個超時。我的index.html如下所示:phonegap:超時錯誤調用webviewclient

<!DOCTYPE html> 
<html> 
<head> 
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" /> 
    <title>Mængderabat - spar mere</title> 
    <script src="http://debug.phonegap.com/target/target-script-min.js#maengderabat"></script> 
    <script src="phonegap.js" charset="utf-8"></script> 
    <script src="assets/js/jquery-1.5.2.min.js"></script> 
    <script src="assets/js/jquery.mobile.js"></script> 
    <script src="assets/js/jquery.jfeed.pack.js"></script> 

    <link rel="stylesheet" href="assets/css/jquery.mobile.css" /> 
    <style> 
    .ui-li-icon{width:16px;height:16px;} 
    </style> 
</head> 
<body > 
<!-- begin first page --> 
<section id="main" data-role="page" data-theme="b"> 
    <header data-role="header"> 
     <h1>Mængderabat - spar mere</h1> 
    </header> 
    <div data-role="content" class="content"> 
     <ul id="list" data-role="listview" data-inset="true"> 
     </ul> 
    </div> 

    <footer data-role="footer"> 
     <h2>example by Oikos Development</h2> 
    </footer> 
</section> 
<!-- end first page --> 
    </body> 
</html> 

回答

0

我對PhoneGap的構建不太熟悉,但是您的路徑正確嗎?我認爲這將是js/jquery *如果您的www文件夾中有一個js文件夾。

另外,您正在從debug.phonegap.com加載遠程資源。可能這會讓你放慢腳步。

+0

感謝您的回答。 JQuery的路徑是由我定義的,它是正確的。調試很好,不幸的是,這也不是導致問題的原因。這可能是與手機構建更加微妙相關的東西。我可能需要更徹底地查看文檔,看看我是否漏掉了應用程序的設置。儘管感謝您的回答。 – Jakob 2012-02-07 20:42:23

+1

您可能更願意從PhoneGap Build的幫助中詢問getsatisfaction:http://community.phonegap.com/nitobi/products/nitobi_phonegap_build?from_gsfn=true – 2012-02-08 14:05:03

+0

謝謝Simon - 我不知道這個社區。您是否願意改變您對該社羣的參考答案,以便我可以接受這個答案,還是反對SO政策? – Jakob 2012-02-08 16:12:39

1

增加超時在你的主(PhoneGap的)活動:

setIntegerProperty("loadUrlTimeoutValue", 30000); 
+0

這爲我做了詭計! – happyhardik 2012-12-21 11:23:32

+0

可以請你告訴我在哪裏添加此.. – 2013-12-10 13:05:20

+0

正如我所說:「在你的主要(phonegap)活動」初始化webview。 – Siarhei 2013-12-10 17:37:03