【问题标题】:Hyperlink to a website using node-webkit使用 node-webkit 超链接到网站
【发布时间】:2016-04-26 04:38:39
【问题描述】:

请大家帮忙,我需要一个完整的编码教程,教我如何从 Windows 操作系统上的节点 webkit 桌面应用程序打开网站。

是的!我已经搜索并看到了 gui.Shell.openExternal("http://www.example.org") 但我不知道如何将其链接起来,尤其是使用 html 超链接(a)标签!

谢谢!

【问题讨论】:

  • 这有帮助吗:<a href='...' onclick='gui.Shell.openExternal(this.href);return false'>...?

标签: javascript html node.js node-webkit


【解决方案1】:

我终于找到了一种方法,这里就是我使用的代码。

var gui = require('nw.gui');

在你的 html 链接标签中,创建一个 id = "GoToWebsite"

document.getElementById('GoToWebsite').onclick = function(){gui.Shell.openExternal('http://www.nickzom.org');};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-14
    • 2021-03-31
    • 1970-01-01
    • 2020-06-30
    • 2013-09-27
    • 2011-11-27
    • 2014-04-18
    • 1970-01-01
    相关资源
    最近更新 更多