I have the following in my HTML5 code which makes use of javascript:
var myObj = localStorage[dataObj];
alert(myObj);
alert(myObj.City);
When I do alert(myObj) it shows {"ID":68,"City":New York} which is what is in var. I now need to get the value of City. I do the following but it shows as undefined: alert(myObj.City); I also tried
alert(myObj[0]:City) but that did not work as well
alertshowed that, it's a string. If youalertan object, you get[object Object].