I'd like to get data from a webpage and store it in a javascript array, but still have access when a user navigates to a new page. What's the best way to do this--setting a cookie, serialization, or?
I'd like to get data from a webpage and store it in a javascript array, but still have access when a user navigates to a new page. What's the best way to do this--setting a cookie, serialization, or?
It depends how much data you're storing. Serializing to a cookie is a good option if there's not much data. You will need to make sure cookies are enabled Take a look at eval and the toSource() method of the Array object. You can also store data in the url, in query strings or anchors.