【发布时间】:2018-10-23 13:07:02
【问题描述】:
我通过这个命令行在我的phonegap项目中安装“inAppBrowser”插件:
cordova plugin add cordova-plugin-inappbrowser
并在 index.html 中写下代码:
<a id="eghdamat_ghabl" href="#" onclick="window.open('http://apache.org', '_blank', 'location=yes'); return false;">click me</a>
但它不会打开链接。
config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.hello" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<icon src="icon.png" />
<splash src="splash.png" />
</widget>
【问题讨论】:
标签: javascript cordova phonegap-plugins phonegap