(^278) CHAPTER 18 ■ AJAX AND JSON
if(key == "date") {
return new Date(value);
} else {
return value;
}
}
function showJsonData() {
//Create an object
original = {'date':'01/01/2007', 'data':'some data'};
json = original.toJSONString();
div = document.getElementById("jsonData");
restored = json.parseJSON(convertDates);
div.innerHTML = restored['date'].toString();
}
Show JSON Data