188
rated 0 times
[
191]
[
3]
/ answers: 1 / hits: 108540
/ 12 Years ago, thu, july 5, 2012, 12:00:00
No jQuery.
I want to store an object or array in a cookie.
The object should be usable after page refresh.
How do I do that with pure JavaScript? I read many posts, but do not know how to serialize appropriately.
EDIT:
Code:
var instances = {};
...
instances[strInstanceId] = { container: oContainer };
...
instances[strInstanceId].plugin = oPlugin;
...
JSON.stringify(instances);
// throws error 'TypeError: Converting circular structure to JSON'
How do I serialize
instances
?How do I maintain functionality, but change structure of instance to be able to serialize with
stringify
?
More From » object