Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing Variables to a new page without query string

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

like image 589
Micah Armantrout Avatar asked Aug 16 '13 01:08

Micah Armantrout


1 Answers

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.

like image 105
Bryce Avatar answered Oct 23 '22 23:10

Bryce