You can serialize your Array/Objects into a String using
JSON.stringify
so if you have an Array like
var arr = [1,2,3,4]
JSON.stringify(arr) // "[1,2,3,4]"
And then pass it using an GET parameter to your other page
In which you could acces it using something like this
function get(q,s) {
s |= window.location.search;
var re = new RegExp('&'+q+'(?:=([^&]*))?(?=&|$)','i');
return (s=s.replace(/^\?/,'&').match(re)) ? (typeof s[1] == 'undefined' ? '' : decodeURIComponent(s[1])) : undefined;
}
If you'r url were www.example.com/?arr="[1,2,3]"
get("arr")
Would return
"[1,2,3]"
of course you could also store this String in a Cookie
or in the localStorage
Object (which is only supported by modern browsers)
Then you can use
JSON.parse
var arr = JSON.parse("[1,2,3,4]");
arr // [1, 2, 3, 4]