将值从一个页面发送到另一个页面 [英] Send value from one page to another

查看:85
本文介绍了将值从一个页面发送到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2页说index.html和2ndPage.html。
index.html有两个文本框和一个按钮。现在我想在文本框中输入一些数据并在2ndpage.html中收到数据。我只想使用JavaScript。不想使用查询字符串。只发布或获取方法。可能吗?请帮助我或指导我如何在javascript / jquery中将数据从一页发送到另一页。使用localStorage或使用localStorage或使用localStorage或sessionStorage你可以做到这一点。这里有一个链接,它会帮助你。我只是从一个页面到另一个页面几个CSS属性。但你也可以输入输入值。
将css属性从一个html页面转换为另一个页面



或者如果您正在照顾旧浏览器,那么javascript位置对象就是要走的路。


I have 2 pages say index.html and 2ndPage.html. index.html has two textboxes and a button. Now i want to enter some data in the textboxes and received the data in 2ndpage.html. I want to use only javascript. dont want to use query string. Only post or get method. Is it possible? Please help me or guide me how to send and receive data form one page to another in javascript/jquery.

解决方案

using localStorage or sessionStorage you can do this. here is a link, which will help you. i just take few css property from one page to another page. but you can take input value also. Taking css property from one html page to another page

or if you are taking care of old browser also then javascript Location object is the way to go.

这篇关于将值从一个页面发送到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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