使用nodejs从表单中存储数据并表达
我需要从表单作为后请求的表单中获取一些数据并保存该数据,以便我可以在另一个页面上使用它。 成功地将数据表格检索为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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.