gpt4 book ai didi

node.js - node-webkit http.Server 和页面更改

转载 作者:太空宇宙 更新时间:2023-11-04 01:12:22 25 4
gpt4 key购买 nike

我使用node-webkit编写了一个应用程序。我想使用 HTTP 在运行我的应用程序的计算机之间进行网络通信。如果服务器是从该页面启动的,我可以在不重新启动服务器的情况下更改当前页面吗?

我考虑过子进程,但我想用我的应用程序关闭服务器。我不想对服务器使用特殊的网络请求来关闭它。

我可以在不重新启动服务器的情况下更改当前页面吗?我可以在页面更改时保存子进程对象吗?您知道其他方法吗?

附注对不起我的英语。

最佳答案

我在node-webkit文档中找到了答案。

In node-webkit, you can basically do the same thing by using window.location, you can install it in the onclick event of a link and node-webkit will navigate to a new page when user clicks it. But by doing this you would lose everything in window context, you can save everything in cookies like old web pages, or you can save things in the global variable, which resides in Node.js's context and will live through your app.

关于node.js - node-webkit http.Server 和页面更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15549415/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com