Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
144 views
in Technique[技术] by (71.8m points)

How to read a JSON file and fill arrays in jQuery?

The JSON file looks like below:

{
  "id": "41",
  "title": "428: SHIBUYA SCRAMBLE",
  "saving": "16,50",
  "imageUrl": "../used-games-generic.jpg"
}, {
  "id": "42",
  "title": "8 DAYS: PEACEKEEPER ED",
  "saving": "3,50",
  "imageUrl": "../used-games-generic.jpg"
}, {
  "id": "43",
  "title": "9 MONKEYS OF SHAOLIN",
  "saving": "10,00",
  "imageUrl": "../used-games-generic.jpg"
}, {
  "id": "44",
  "title": "A.O.T.2 FINAL BATTLE",
  "saving": "6,00",
  "imageUrl": "../used-games-generic.jpg"
}, {
  "id": "45",
  "title": "ACES OF THE LUFTWAFFE SQUADRON ED",
  "saving": "6,50",
  "imageUrl": "../used-games-generic.jpg"
}, {
  "id": "46",
  "title": "ADR1FT",
  "saving": "3,50",
  "imageUrl": "../used-games-generic.jpg"
}

How can I read the JSON file inside of jQuery function and fill with the relative information three arrays?

array.gameTitle = []
array.gameSaving= []
array.gameImageUrl= []
question from:https://stackoverflow.com/questions/65845100/how-to-read-a-json-file-and-fill-arrays-in-jquery

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...