我的Phonegap应用程序如何在Android浏览器中打开链接?我试过很多密码,但都没用。
这是我的实际代码:<a href="http://store.spyfly.tk" target="_system">store.spyfly.tk</a>
和config.xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet href="" type="text/xsl"?>
<!DOCTYPE tag [
<!ELEMENT tag (#PCDATA)>
]>
<tag>
<widget id="tk.spyfly.store.MANOS_VPlan" version="0.1.0">
<name>MANOS-VPlan</name>
<description>
Vertretungspläne für das Martin-Andersen-Nexö-Gymnasium.
</description>
<author email="spyfly@pvpcrafter.tk" href="http://store.spyfly.tk">
spyfly software
</author>
<content src="index.html" />
<access origin="*" />
<preference name="Fullscreen" value="true" />
<preference name="WebViewBounce" value="true" />
</widget>
</tag>我该怎么做。请张贴一些例子。
仍然在应用程序中打开。我的配置:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?xml-stylesheet href="" type="text/xsl"?>
<!DOCTYPE tag [
<!ELEMENT tag (#PCDATA)>
]>
<tag>
<widget id="tk.spyfly.store.MANOS_VPlan" version="0.1.0">
<name>MANOS-VPlan</name>
<description>
Vertretungspläne für das Martin-Andersen-Nexö-Gymnasium.
</description>
<author email="spyfly@pvpcrafter.tk" href="http://store.spyfly.tk">
spyfly software
</author>
<content src="index.html" />
<access origin="*" />
<preference name="Fullscreen" value="true" />
<preference name="WebViewBounce" value="true" />
</widget>
<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />
<access origin="*" browserOnly="true" />
</tag>我的index.xml
<!DOCTYPE html>
<html>
<head>
<title>MANOS-VPlan</title>
<meta charset="ISO-8859-1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<a onclick="openThatLink()">store.spyfly.tk</a>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
function openThatLink() {
window.open('http://store.spyfly.tk', '_blank', 'location=yes');
}
</script>
</body>
</html>我做错什么了?
发布于 2014-03-27 19:17:46
<a onclick="openThatLink()">store.spyfly.tk</a>
function openThatLink() {
window.open('http://store.spyfly.tk', '_system', 'location=yes');
}发布于 2014-03-28 07:25:30
试试这个:-
window.open('http://store.spyfly.tk', '_blank', 'location=yes');在您的config.xml中包括:
<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />
<access origin="*" browserOnly="true" />InAppBrowser是一个web浏览器,在调用window.open时显示在应用程序中。
参考Phonegap Doc
https://stackoverflow.com/questions/22696921
复制相似问题