Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
154
rated 0 times [  155] [ 1]  / answers: 1 / hits: 19798  / 14 Years ago, wed, august 4, 2010, 12:00:00

Does anyone have a piece of JavaScript code that creates a cookie and stores an array in it? If you also have the code to read through through cookie and delete it, that would be great as well. Thanks!


More From » arrays

 Answers
68

have a look at:
http://plugins.jquery.com/project/cookie https://plugins.jquery.com/cookie/



to store an array



$.cookie('COOKIE_NAME', escape(myarray.join(',')), {expires:1234});


to get it back



cookie=unescape($.cookie('COOKIE_NAME'))
myarray=cookie.split(',')

[#96023] Monday, August 2, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
micah

Total Points: 295
Total Questions: 104
Total Answers: 92

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
micah questions
Mon, Jan 24, 22, 00:00, 2 Years ago
Thu, Dec 31, 20, 00:00, 4 Years ago
Thu, Aug 27, 20, 00:00, 4 Years ago
Wed, Apr 15, 20, 00:00, 4 Years ago
;