我正在尝试学习 JQuerymobile,我正在做类似下面的事情,只是想检查 JQueryMobile 是否支持这样的事情
function BooksCategory () {
ID = '';
title = '';
imgURL = '';
description = '';
bookCounts= '';
Books = [];
};
function Books () {
categoryID = '';
bookID = '';
name = '';
imgURL = '';
Cost = '';
termsandcondition = '';
}
this.booksCategory = [];
ParseResponse()
{
session.CatagoriesCount = response.BooksCategory.length;
for (var k=0; k < session.CatagoriesCount; k++)
{
session.booksCategory[k] = new BookCategory();
var NoOfBooks = session.BooksCategory[k].bookCounts
for (var j=0; j<NoOfBooks; j++)
session.booksCategory[k].Books[j] = new Books();
}
}
为什么我收到此语句的“未捕获类型错误:无法读取属性 '0'”
session.booksCategory[k].Books[j] = new Books();
如果这不是正确的方法,我们如何在数组中动态创建数组?
问候拉维