我有一個Web服務,返回一個JSON編碼的數據數組。然後,我使用jQuery的.each()
函數遍歷該數組,但在Firefox中迭代,而在Chrome中迭代。更改爲.each()在Firefox和鉻
從Web服務來sback的數據是:
{
"data": {
"610": {
"id": "610",
"url": "a url 1",
"description": "XXX YYY",
"toc": "0000-01-00",
"active": "1"
},
"608": {
"id": "608",
"url": "a url 1",
"description": "ytttgffrr",
"toc": "0000-01-00",
"active": "1"
},
"607": {
"id": "607",
"url": "a url 3",
"description": "rtretert3",
"toc": "0000-01-00",
"active": "1"
},
"606": {
"id": "606",
"url": "a url 4",
"description": "xxxwwww",
"toc": "0000-01-00",
"active": "1"
},
...
}
}
火狐進入610 - > 606,而鍍鉻FORS 606 - > 610
任何想法,爲什麼和我能做些什麼?
也許相關http://stackoverflow.com/questions/640745/google-chrome-javascript-associative-arrays-evaluated-out-of-sequence – 2012-03-23 16:48:38
http://stackoverflow.com/questions/648139/is-the在JavaScript中的對象可預測的時間順序 - – Dogbert 2012-03-23 16:49:06