I have some data stored in a JavaScript array which I want to send to some other page. Is it possible to do this without utilizing any server-side scripting like PHP? Can it be done with JS or jQuery or something like that? Ideally, I want to be able to access that array in my JS script on the other page.
Thank you
You can serialize your Array/Objects into a String using
JSON.stringifyso if you have an Array like
And then pass it using an GET parameter to your other page
In which you could acces it using something like this
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
Cookieor in thelocalStorageObject (which is only supported by modern browsers)
Then you can use
JSON.parse