我突然遇到一个问题,我之前正在使用的代码(Facebook分享)。 应该在浏览器中打开的URL现在从应用程序本身打开。
JS:
window.open(url,"_system","location=yes");
config.xml中
<?xml version="1.0" encoding="UTF-8"?>
<!-- config.xml reference: https://build.phonegap.com/docs/config-xml -->
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.test"
version = "1.1">
<name>test</name>
<description>
test
</description>
<author href="http://www.test.de" email="tesdt@test.de">
test
</author>
<feature name="http://api.phonegap.com/1.0/device" />
<feature name="http://api.phonegap.com/1.0/geolocation"/>
<preference name="phonegap-version" value="3.3.0" />
<preference name="splash-screen-duration" value="25000" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="android-installLocation" value="auto" />
<preference name="stay-in-webview" value="false" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<access origin="*" browserOnly="true" /> <!-- allow local pages -->
</widget>
我尝试了各种选项,如:
试用1:
navigator.app.loadUrl(url, { openExternal:true } );
试用2:
var myURL ="http://www.google.com/";
myURL = encodeURI(myURL);
window.open(myURL, "_system", 'location=yes');
试用3:
window.open(url,"_blank","location=yes");
要通过window.open()打开的示例网址:
但似乎没有任何效果。任何帮助是极大的赞赏。