外部链接cordova不工作
external link cordova not working
在使用codova
的小应用程序上工作,我试图在浏览器上打开链接,但这不起作用,我不知道为什么,它只在webview
中打开。
<a href='#' onclick='openURL("http://google.com")'/>LInka</a>
<a href='#' onclick='window.open("http://google.com", '_system')'/>LInka</a>
function openURL(urlString){
myURL = encodeURI(urlString);
window.open(myURL, '_blank');
}
我有同样的问题,包括你的cordova.js在你的页面
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<title>Hello World</title>
</head>
<body>
<a onclick="navigator.app.loadUrl('yourwebsite.com', { openExternal:true });">Links</a>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
function openURL(urlString){
myURL = encodeURI(urlString);
window.open(myURL, '_blank');
}
</script>
尝试创建一个新项目,并确保index.html看起来像这样不需要包含inappbrowser祝你好运,希望有帮助
相关文章:
- Cordova ng路线工作不正常
- JSON:查询联接表不工作(Cordova Mobile)
- Javascript无法与Onsen一起在Cordova工作
- cordova背景地理定位无法在背景上工作
- 带有cordova的ios上的Jquery.text()无法正常工作
- 为什么我的代码可以在chrome上工作,而不是一次使用cordova编译
- Cordova iframe在iOS Safari中工作,但在Android中不起作用
- 带有Firebase的Cordova将无法正常工作
- Cordova / Phonegap iOS Safari和语音合成将无法正常工作
- Cordova/PhoneGap: setInterval() / setTimeout() 无法正常工作
- Phonegap/Cordova 2.9自定义插件创建.任何工作示例
- Cordova Android禁用后退按钮[不工作]
- cordova.js无法在远程页面上工作
- Cordova罗盘API(navigator.compass.watchHeading)不工作(错误代码3)
- Cordova+AngularJs路由不工作
- webkit playsinline在返回到cordova iOS应用程序中的页面时停止工作
- cordova插件文件在浏览器中无法正常工作
- Phonegap插件不工作(cordova-plugin-purchase)
- 通知.警告不工作cordova版本4+
- 导航器.在线不工作cordova 5.0.0