好吧,我被这个难住了。我需要遍历这些,所以我可以按类别列出这样的东西
商业书籍
第一册
书 2
书 3
烹饪书籍
ETC..
但无法弄清楚如何遍历嵌套对象。有或没有 jquery 都很好
window.books = {
"Business Books": [
{
Title: "Finance 101",
Description: "Info for Finance 101 book goes here."
},
{
Title: "Economics 123",
Description: "Info for Economics 123 book goes here."
},
{
Title: "Statistics for Beginners",
Description: "Learn about Statistics."
}
],
"Cooking Books": [
{
Title: "Lowfat Treats",
Description: "Eat a lowfat Diet"
},
{
Title: "Chocolate Lovers",
Description: "Eat a lot of chocolate"
},
{
Title: "Book of Brownies",
Description: "Stuff about Brownies"
}
],
"IT Books": [
{
Title: "Windows XP",
Description: "Please go away"
},
{
Title: "Linux",
Description: "A how to guide."
},
{
Title: "Unix",
Description: "All about Unix."
},
{
Title: "Mac",
Description: "Costs too much."
}
],
};