简体   繁体   中英

How do I store data in a json file?

For a class project we have to build an online store in 3 parts: html, css and js, the first 2 are done but i'm at a loss about js! We should be able to put the info of one product in a json file, and parse it in html. but tbh i'm not even sure how or where to begin with it, any suggestions are appreciated! Thanks!

First you can start by creating your JSON file that has all the information about the store that you want, then you can use JavaScript to read the data in that file. Finally you can use HTML and some binding to parse and show whatever you want. I can help you out if you post some sample code or a jsfiddle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM