在Apache Cordova中设置链接 [英] Set up links in the Apache Cordova

查看:72
本文介绍了在Apache Cordova中设置链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在起始页"中,来自"config.xml"文件中,我插入以下网址:"http://www.testapp.com/app/index.php"

打开主页,但是单击任何链接都会在外部浏览器中打开.

是否有任何配置,当您单击链接时都不会调用外部浏览器并在自己的应用程序中打开链接?

我不想使用javacript或任何其他技巧来做到这一点.

在此先感谢:)

In the "Start Page" from the "config.xml" file, I insert the following url: "http://www.testapp.com/app/index.php"

Open the home page, but clicking on any link it opens in an external browser.

Is there any configuration that when you click the link it does not call an external browser and open the link in own application?

I did not want to use javacript or any other artifice to be able to do this.

thanks in advance :)

推荐答案

要在新窗口中打开:

将目标设置为 _blank

_openBlogPage: function() {
        window.open("http://ska-studios.com/", "_blank");    
},

要在您的应用程序中打开:

使用关键字

function openPages () {
  var self          = this;
  charlieMurder.addEventListener('click', self._openCharlieMurderPage, false);
}

_openCharlieMurderPage: function() {
        window.open('http://marketplace.xbox.com/en-US/Product/Charlie-Murder/66acd000-77fe-1000-9115-d80258410b83', "blank");
},


我有一个示例来说明这一点. ska.js 文件.

I have a sample that to illustrate this. You can find it in the ska.js file.


这篇关于在Apache Cordova中设置链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆