使用nodejs从表单中存储数据并表达

发布于 2025-02-01 20:25:38 字数 216 浏览 2 评论 0原文

我需要从表单作为后请求的表单中获取一些数据并保存该数据,以便我可以在另一个页面上使用它。 成功地将数据表格检索为JSON,但是由于我没有使用任何数据库,因此当我重定向下一页时,我无法看到从表单中检索到的数据。

我 玉,nodejs和Express。我想对如何检索我通过Post方法发送的数据有意见。 如果我使用渲染,它将为页面加载所有正确的信息,但是如果我重新加载或更改为另一个页面,则数据将简单消失。

I need to get some data from a form as POST request and save that data so i can use it on another page.
I am successful at retrieving the data form the form as JSON, but since i am not using any database, i am not able to see the data that i retrieved from the form when i redirect for the next page..

I am new at using jade, nodejs and express. I'd like a opinion on how to retrieve the data that i've sent via post method.
If i use render, it loads the page with all the correct info, but if i reload or change to another page, the data will simple disappear.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独陪着我 2025-02-08 20:25:38

您可以使用 Redux Persist(状态管理工具)本地存储来保存数据。这两个都将以导航到下一页或重新加载页面时可以检索的方式保存您的数据。

You can use Redux Persist (state management tool) or local storage to save data. Both of these will save your data in a way that it can be retrieved when you navigate to the next page or even if you reload your page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文