2
在javascript數組中,包含值(即;類型是對象)。該對象包含另一個值數組。這個數組內有3個對象。而對象有一些變量。如何一個變量推到另一個數組在javascript如何訪問javascript數組中的responsedata包含對象
var studentData = new Array();
success: function(responseData) {
$.each(responseData, function(index, item) {
studentData.push(responseData.markMasterList(0).markMasterDetails(i).student.name);
responseData顯示..
Array[5]
>0: Object
>markArray: Array[1]
>0: Object
>markDetailsArray: Array[10]
>0: Object
>student: Object
>name //How to push this variable to studentData
>1: Object
>2: Object
>3: Object
>1: Object
我試圖與這一個,但在控制檯上有錯誤
studentData.push(responseData.markMasterList(0).markMasterDetails(i).student.name);
錯誤顯示:
Uncaught TypeError: object is not a function