I pass an associative array (id => val) using Ajax and get it using jQuery $ .getJSON, which read the data correctly and prepared the object. There is, however, a very annoying sorting problem.
It seems that in Chrome and IE, the data is sorted by the id part of the associated array. Therefore, if the array should be (5 => 'xxx', 3 => 'fff'), it actually becomes (3 => 'fff', 5 => 'xxx'). In FireFox, it works as expected, i.e. Not sorted.
Any ideas?
javascript jquery sorting ajax getjson
Collector Feb 21 '12 at 14:20 2012-02-21 14:20
source share