我正在为 android 开发一个 phonegap/jquery-mobile 测试应用程序(我是这项技术的新手),我想在我的应用程序中显示一个存储在 Internet 站点上的图像。在 avd 中的应用程序启动期间,当我将这个元素放入 index.html 时,我会收到此通知:
<img src="http://www.comolakeboats.it/images/stories/boats/gommone_12_150x100.jpg" width="120px;" />
Application Error - the connection to the server was unsuccessfull (file:///android_asset/www/index.html)
在 log.cat 我可以看到这个错误:
E/DroidGap(337): DroidGap: TIMEOUT ERROR! - calling webViewClient
我已经使用外部链接检查了来自浏览器和应用程序内部的连接,在这两种情况下我都可以访问 Internet 站点。
我缺少什么?是否也存在适用于 Iphone 的解决方案(可能相同)?
这是我的代码:
<body>
<div data-role="page" id="home_it">
<div data-role="header" data-theme="a" id="it">
<h1>TEST</h1>
<div data-role="navbar" data-iconpos="right" data-theme="a">
<ul>
<li><a href="tel://+3933333333">Tel:+3933333333</a></li>
<li><a href="mailto:info@test.it?subject=Info">Email</a></li>
</ul>
</div>
<div class="ui-body ui-body-c"><!-- ui-body-b">-->
<p>Some text</p>
<button id="my_list_button">Mostra</button>
</div>
</div>
<div data-role="content" class="ui-body">
<ul data-role="listview" id="my_list">
<li data-role="list-divider">My list</li>
<li>
<a href="http://www.comolakeboats.it" rel="external">
<img src="http://www.comolakeboats.it/images/stories/boats/gommone_12_150x100.jpg" width="120px;" />
<h3>title foo foo</h3>
<p style="color:red">foo foo foo foo</p>
</a>
</li>
</ul>
</div>
<div data-role="footer">
<div data-role="navbar" data-iconpos="right" data-theme="a">
<ul>
<li><a href="#home" data-icon="home"> </a></li>
<li><a id="exit-app" data-icon="back"> </a></li>
</ul>
</div>
</div>
</div>
</body>
先感谢您
最佳答案
你真的更新了phonegap的白名单吗?告诉应用程序允许访问哪些 URL。您也可以在其中添加 *,as described here
希望这可以帮助
关于jquery-mobile - 如何在 phonegap/jquerymobile 应用程序中使用外部图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8339136/