0
我想獲得這個json數組。我怎樣才能json數據jquery
data='{"Status":200,"Method":"SelectCompany","Errors":[],"Data":[{"Name":"MoreTimeAPITest","OrgNumber":"1234561234","APIKey":"168080BF-77A9-4B64-94C3-A5B3B4512A1C","Login":"moretime","Password":"SvMrqwk4G3"}],"DataType":{"Type":"list","ObjectType":"APIConnections"},"ResponseType":"json","API_Version":"1","API_Name":"PromikBook API","Server_Time":"2014-02-13 13:39:56.62275"}';
var newArr = [];
我用這段代碼。但它不起作用。
$.each(data, function(i, obj) {
console.log([obj.Status]);
newArr.push([obj.Status]);
});
數據是一個字符串不是一個對象 –
@user ......你需要解析JSON –
目前尚不清楚你想要的結果是什麼。您在問題中顯示的數據在整個對象中只有一個「Status」屬性,因此您不清楚數組中的內容。 – jfriend00