I am using the following JSON to create few checkboxes using JavaScript.
{"5":"5.5\" x 8.5\"",
"11":"7\" x 10\"",
"4":"8.5\" x 11\"",
"8":"8.5\" x 14\"",
"12":"10\" x 7\"",
"2":"11\" x 8.5\"",
"10":"11\" x 17\"",
"6":"14\" x 8.5\"",
"9":"17\" x 11\""})
The JavaScript to create those checkboxes is:
for(id in dimensions) {
$("#the_dimensions").append('<label class="checkbox">' +
'<input type="checkbox" class="dimensions-filter" value="' + id + '">' +
dimensions[id] + '</label>');
}
On Firefox, the checkbox is created as per the order in the JSON object. So, "5":"5.5\" x 8.5\"" becomes the first element, "11":"7\" x 10\"" becomes the second element, so on.
But on Chrome and IE, the JSON object gets sorted automatically in an ascending order of keys. So, "2":"11\" x 8.5\"" becomes the first element, "4":"8.5\" x 11\"" becomes the second element, so on.
How can I disable auto sorting on Chrome and IE?