简体   繁体   English

使用jQuery在两个不同页面之间传递值

[英]pass values between two different pages using Jquery

can any one tell me how to do this in JQuery? 谁能告诉我如何在JQuery中做到这一点?

i have two .aspx pages named default1.aspx and default2.aspx. 我有两个.aspx页面,分别名为default1.aspx和default2.aspx。 default1.aspx has one textbox named as textbox1 and default2.aspx has one textbox named as textbox2. default1.aspx有一个名为textbox1的文本框,default2.aspx有一个名为textbox2的文本框。 default1.aspx opens the default2.aspx by using window.showmodaldialog(). default1.aspx通过使用window.showmodaldialog()打开default2.aspx。 Issue is that While i am changing the text of textbox2, the textbox1 text also gets changed. 问题是,当我更改textbox2的文本时,textbox1的文本也会更改。

one possible way to do it using cookies 一种使用Cookie的方法

check it here 在这里检查

Create, read, and erase cookies with jQuery 使用jQuery创建,读取和擦除cookie

another way to do this if you is to use html5 webstorage 如果您要使用html5 webstorage,则可以这样做

firstpage 第一页

localStorage.value="value";

secondpage 第二页

var value=localStorage.value;

http://www.w3schools.com/html/html5_webstorage.asp http://www.w3schools.com/html/html5_webstorage.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM