I have been struggling with a few lines of Javascript code which should be straightforward. I have reduced my JSON String to the one found hereafter. The first alert in the code hereafter generates the following message:
{"list":[{"text":"Text1", "created_at":"Date1"},{"text":"Text2", "created_at":"Date2"}]}
However, the second alert generates the following error in IE: Error: Unable to get value of the property '0': object is null or undefined
var data = "{\"list\":[{\"text\":\"Text1\", \"created_at\":\"Date1\"},{\"text\":\"Text2\", \"created_at\":\"Date2\"}]}";
alert(data);
alert(data.list[0].created_at);
Would anyone understand why I am receiving this error?