I want to know how to share an array through two HTML files.
I have two HTML files and I want to share an array between them.
I point out array because for this, I can't use localStorage
because it is an array, and I can't use split()
because my array has objects in it:
var examplearray = [
{first: "Nice!", second: "Wonderful!"},
{first: "Wow!", "Amazing"}
]
I tried linking both of the HTML files to one javascript file, and put the variable there, and alert()
the variable to test, but it didn't work. Please show me if there is a way tp share an array between two HTML files.