将变量传递到没有查询字符串的新页面 [英] Passing Variables to a new page without query string

查看:85
本文介绍了将变量传递到没有查询字符串的新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以将1页上的弹出iframe的变量传递给客户端的弹出窗口(iframe),而不使用查询字符串?我的变量太大而无法使用查询字符串?



提出同样问题的另一种方法

有没有一种方法可以将一个页面上的变量从一页传递到另一页上,而不使用查询字符串?我的变量太大,不能使用查询字符串?



这是用于IE 8和更高版本的html 5存储不起作用 / 2010/10/11 / local-storage-and-how-to-use-it /rel =nofollow> HTML5 LocalStorage 。这是一个JavaScript对象,可以保存大约5MB左右的字符串。



如果您需要存储除字符串以外的其他数据,则可以使用JSON.stringify()和JSON .parse()在数据类型和字符串之间进行转换。

不使用HTML5



您可以选择使用 cookies 并使用JavaScript获取/设置它们,否则有很多LocalStorage polyfills可供选择,应该可以在受限制的环境中工作。

Is there a way to pass a variable from 1 page that has a popup iframe on it to the popup (iframe) on client side button click without using query strings? my variable is too big to use a query string?

Another way to ask the same question

Is there a way to pass a variable from 1 page to another page on client side button click without using query strings? my variable is too big to use a query string?

This is for use on IE 8 and higher html 5 storage will not work

解决方案

If your two pages are on the same domain, you can use HTML5 LocalStorage. It's a JavaScript object that can hold strings up to around 5MB or so.

If you need to store other data than strings, you can use JSON.stringify() and JSON.parse() to convert between your datatypes and strings.

Without HTML5

You have the option to use cookies and get/set them with JavaScript, otherwise there are many LocalStorage polyfills to choose from which should be able to work in restricted environments.

这篇关于将变量传递到没有查询字符串的新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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