The array (note order of items):
{
"5":{
"Title":"Title A",
"Desc":"Description A"
},
"15":{
"Title":"Title B",
"Desc":"Description B"
},
"10":{
"Title":"Title C",
"Desc":"Description C"
},
"1":{
"Title":"Title D",
"Desc":"Description D"
},
"20":{
"Title":"Title E",
"Desc":"Description E"
}
}
Now, the js code below does change order if run on chrome or IE9.
for ( var i in data ) {
alert(JSON.stringify(data[i]));
}
IE8 preserves original order, while newer browsers change the order to 1, 5, 10 ,15, 20.
Any idea why this may be happening? Is it possible to preserve original order in newer browsers?
Many thanks, Luke