如何保持json.parse的订单?

时间:2014-05-08 07:36:36

标签: javascript json

我有一个像这样的对象: { "01":"111","02":"222","11":"AAA","12":"BBB"}。但是在JSON.parse之后,对象改变了它的顺序,如{"11":"AAA","12":"BBB","01":"111","02":"222"}。见http://jsfiddle.net/stxh/3WV8Y/

代码:

var str=JSON.parse('{"01":"111","02":"222","11":"AAA","12":"BBB"}');
alert( JSON.stringify(str) );

我可以保留JSON.parse的订单吗?

0 个答案:

没有答案