I have saved a JSON file in my local system and created a JavaScript file in order to read the JSON file and print data out.
(我已在本地系统中保存了一个JSON文件并创建了一个JavaScript文件,以便读取JSON文件并打印出数据。)
Here is the JSON file:(这是JSON文件:)
{"resource":"A","literals":["B","C","D"]}
Let's say this is the path of the JSON file: /Users/Documents/workspace/test.json
.
(假设这是JSON文件的路径: /Users/Documents/workspace/test.json
。)
Could anyone please help me write a simple piece of code to read the JSON file and print the data inside it in JavaScript?
(有谁能帮我写一段简单的代码来读取JSON文件并用JavaScript打印其中的数据?)
ask by user2864315 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…