4

我正在尝试调试我的 phonegap 应用程序。当我尝试在我的模拟器上打开我的应用程序时,我收到一条错误消息The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

我应该提到我正在使用 phonegap 构建,所以我没有任何本机代码。奇怪的是我只加载本地资源,所以我不明白为什么我会超时。我的 index.html 看起来像这样:

<!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>
4

2 回答 2

1

增加主要(phonegap)活动的超时时间:

setIntegerProperty("loadUrlTimeoutValue", 30000);
于 2012-04-26T10:38:46.973 回答
0

我对 PhoneGap 构建不是很熟悉,但你的 jQuery 路径是否正确?如果您的 www 文件夹中有一个 js 文件夹,我认为它将是 js/jquery*。

此外,您正在从 debug.phonegap.com 加载远程资源。可能这会让你慢下来。

于 2012-02-07T20:17:52.237 回答