Jump to content


Photo

Assign value to cookie


  • Please log in to reply
No replies to this topic

#1 jarvis

jarvis

    Advanced Member

  • Members
  • PipPipPip
  • 334 posts

Posted 03 July 2014 - 06:47 AM

Hi All,

 

I hope someone can help!

 

I've got some code that passes an array of values via an ajax call. This works fine and I can see my values in the specified div:

$("#container").html(data);

What I'd like to do, is get that info and pass it to a cookie. However, I'm struggling a tad. I currently have this:

var set_me = html(data);
$.cookie('choice',set_me, {expires: 7, path: '/'});
alert( $.cookie("choice") );

But sadly it's not working. I think it's something simple but this is new to me some need some help please

 

Thanks






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com