So I'm new to jQuery and JSON but this is pretty straight forward and the fact the it isn't working is frustrating me.
I have an ASP.NET MVC Web site. I'm using AJAX (through jQuery) to load some data. Everything is well and good up until there.
I'm trying to store my result in a cookie by using carhartl / jquery-cookie.
The problem is when I try to store my data in a cookie the data isn't really stored. I'm using the code below:
var jsonObj = JSON.stringify(result);
jQuery.cookie("resultData", jsonObj, {
expires: 2,
path: "/",
json: true
});
jQuery.cookie("resultData")
returns null
I've tried running the same code but instead of my actual data I wrote "hello word" which worked just fine.
Can anyone help me please ?