I've been having a lot of trouble with keeping the keys in a JSON object in their original state after they've been parsed by jQuery's $.each(). Even with string keys they are still being sorted into numerical order. Here is the JSON before parsed by jQuery:-
{
"success": "true",
"data": [
{
"row_13": {
"id": "1_",
"name": "_",
"email": "_",
"subject": "_",
"body": "_",
"ip": "_",
"starred": "_"
},
"row_11": {
"id": "_",
"name": "_",
"email": "_",
"subject": "_",
"body": "_",
"ip": "_",
"starred": "_"
},
"row_12": {
"id": "_",
"name": "_",
"email": "_",
"subject": "_",
"body": "_",
"ip": "_",
"starred": "_"
},
"row_10": {
"id": "_",
"name": "_",
"email": "_",
"subject": "_",
"body": "_",
"ip": "_",
"starred": "_"
}
}
]
}
However, once parse by jQuery, the order is as follows:-
"row_10", "row_11", "row_12", "row_13"
What on earth is causing this? It has been bugging me for at least a day now.