PhoneGap的在Android不会加载外部脚本 [英] PhoneGap on Android wont load external scripts
问题描述
我做一个简单的应用程序,将加载谷歌地图。但问题是,每次我加载此
I'm making a simple app that will load a google map. but the problem is everytime I load this
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
它不会在我的Android模拟器上运行,同时在桌面上正常工作。我怎么才能让PhoneGap的还是Android允许外部脚本工作/负载?
It wont run on my android emulator while on desktop it works fine. how can I let Phonegap or Android allow external scripts to work/load?
更新:我总是得到这个错误应用程序错误:。到服务器的连接失败(文件/// android_asset / WWW / index.html的),但如果我删除了谷歌地图脚本,它的工作原理
UPDATE: I always get this error "Application Error: The connection to the server was unsuccessful.(file///android_asset/www/index.html). But if I removed the google map script. it works.
推荐答案
其实,白名单是问题就像@TDeBailleul说,但他指的是白名单的iOS中的位置不是机器人。
Actually, the whitelist is the issue like @TDeBailleul said, but he was referring to the location of the whitelist in iOS not Android.
在Android上,它是在/res/xml/PhoneGap.xml
In android, it is in /res/xml/PhoneGap.xml
有一个在该答案本文件的一个例子: http://stackoverflow.com/a/9187479/878602
There is an example of this file in this answer: http://stackoverflow.com/a/9187479/878602
这篇关于PhoneGap的在Android不会加载外部脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!