I receive following json object:
{
"ActivitySummary": [
{
"Client": "TOTAL",
"RGUs": "18",
"CANCELLED": "1",
"PENDING": "17"
},
{
"Client": "ATT",
"RGUs": "2",
"CANCELLED": "1",
"PENDING": "1"
}
]
}
But when I parse this object using jQuery.parseJSON()
it changes the order of properties i.e Client
moves on second place, 'CANCELLED' to the first and so on:
var array=[
{CANCELLED:"1",Client:"TOTAL", RGUs:"18", PENDING:"1" },
{CANCELLED:"1",Client:"ATT", RGUs:"2", PENDING:"1"}
];
This is how I parse json:
success: function (obj) {
var array = jQuery.parseJSON(obj.data);
}
How can I retain the order? Please help