开发者

Using jQuery to set/retrieve multiple key/value pairs in one cookie using an array

开发者 https://www.devze.com 2022-12-28 03:51 出处:网络
My goal here is to cut down the nu开发者_运维百科mber of cookies I\'m using to store things like persistent states into a single cookie by setting and retrieving multiple key/value pairs within a sing

My goal here is to cut down the nu开发者_运维百科mber of cookies I'm using to store things like persistent states into a single cookie by setting and retrieving multiple key/value pairs within a single cookie using an array.

I'm mostly interested in knowing if someone else has already done this and has written a plugin for it, as I would think this has been done before.


You could serialize the object into a JSON string. That would make it super simple to re-load the object. See question 191881 for information on how to serialize an object to JSON in JavaScript.

0

精彩评论

暂无评论...
验证码 换一张
取 消