我想通過使用下面的代碼在我的HTML中打印此JSON。我有點困惑。 JSON中有嵌套的對象和數組項。有關該問題的更多信息,您可以查看附加的JSon數據和ajax調用片段。 基本上我試圖從包含多本書和教程的json數據中製作一個書籍/教程循環。在HTML中迭代JSON數組
如果json結構錯誤或者可以編寫更好的json結構,請提出正確/更好的結構。
請提前HELP
感謝。
{
"main_heading":"Best Firebase Tutorials & Books",
"sub_heading":"Firebase is a Backend-as-a-Service platform that allows you to develop mobile and web application first introduced in 2011. It was acquired by Google in 2014. Here’s a list of some of the best Firebase books, courses, videos and tutorials to help you learn Firebase in 2017.",
"tutorials":[
{
"0":{
"title":"Starting with Firebase",
"description":"Starting with Firebase by Stone River eLearning will teach you how to code a Firebase application.",
"img_URL":"http://img.cloudimages.us/2012/06/02/computer.jpg",
"link_URL":"#"
},
"1":{
"title":"Angular and Firebase – Build a Web App with Typescript",
"description":"Angular and Firebase – Build a Web App with Typescript by Angular University will teach you to build full-stack applications using Angular and Firebase.",
"img_URL":"http://img.cloudimages.us/2012/06/02/computer.jpg",
"link_URL":"#"
},
"2":{
"title":"Angular 4 and Firebase 3: Create a Instagram-like portal",
"description":"Angular 4 and Firebase 3: Create a Instagram-like portal by Essential Courses will teach you how to code and deploy a complete front-end single page application built using Angular 4 and Firebase 3.",
"img_URL":"https://udemy-images.udemy.com/course/480x270/1283576_e198_3.jpg",
"link_URL":"#"
},
"3":{
"title":"Create a Basic Real-Time Chat App with Angular4 and Firebase",
"description":"Create a Basic Real-Time Chat App with Angular4 and Firebase by Bluelime Learning Solutions will teach you Angular4 and Firebase by creating a real-time chat app from scratch.",
"img_URL":"https://udemy-images.udemy.com/course/480x270/1309766_9048_3.jpg",
"link_URL":"#"
}
}
],
"books":[
{
"0":{
"title":"Firebase Essentials",
"description":"Firebase Essentials – Android Edition by Neil Smyth will teach everything you need to successfully integrate Firebase cloud features into your Android apps.",
"img_URL":"https://reactdom.com/wp-content/uploads/2017/10/51ECBwTcOUL.SL160.jpg",
"link_URL":"#"
},
"1":{
"title":"Firebase Jumpstart",
"description":"Firebase Jumpstart by Angular University is aimed at developers that want to get a practical understanding of the Firebase Realtime Database.",
"img_URL":"https://reactdom.com/wp-content/uploads/2017/10/51zkVSwu7uL.SL160.jpg",
"link_URL":"#"
},
"2":{
"title":"Build Mobile Apps with Ionic 2 and Firebase: Hybrid Mobile App Development",
"description":"Build Mobile Apps with Ionic 2 and Firebase: Hybrid Mobile App Development by Fu Cheng will teach you to build hybrid mobile apps using Ionic and Firebase.",
"img_URL":"https://reactdom.com/wp-content/uploads/2017/10/41atb3tZPiL.SL160.jpg",
"link_URL":"#"
}
}
]
}
請寫出更多的細節,你想怎樣在HTML打印出來? –
我猜這裏有一些東西留在了我的問題中......這裏是JS部分打印HTML 中的vaues(var i = 0; i
DesignerAshish
你想把它放在桌子上嗎? –