0
我想從jQuery的AJAX調用回來一一些具體的數據和數據對象數組看起來像這樣:我是遍歷通過JavaScript對象尋找鍵值
Object {Version: Object, Content: null, StatusCode: 200, ReasonPhrase: "OK", Headers: Array[1]…}
的特定部位興趣是
Headers --> Object -->Key "FORCE_REDIRECT" (FORCE_REDIRECT I wish to find and test if it exists)
然後我想用
Value --> 0 --> "Grid.html" (Grid.html is where i plan to redirect to)
Chrome開發工具的控制檯,這是該數組樣子
console.log(data); // shows me the array
console.log(data.Key); //undefined
console.log(data[0].Key); // blows up
您錯過了'Headers'屬性。嘗試'console.log(data.Headers [0] .Key);' – Griffith