JSON data:
{"2":"Alpha","1":"Beta"}
The data format is fixed, i.e. I can't change it, I can only change the javascript / jQuery code.
$.getJSON("www.myurl.com", function(data) { var items = []; $.each(data, function(key, val) { items.push(key + ', ' + val); }); alert(items); });
Display Chrome, IE9 and Opera: 1, Beta, 2, Alpha
Firefox and Safari mapping: 2, Alpha, 1, Beta p>
Question 1: What is correct?
Question 2: I want the data to be ordered in both Firefox and Safari. The easiest way to ensure Chrome, IE9 and Opera get the same result as Firefox and Safari?
source share