Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

How to parse the json format data automatically?

  • 2 답장
  • 1 이 문제를 만남
  • 4 보기
  • 최종 답변자: cor-el

more options

when: http://192.168.16.131:6900/query/v1/mp4/11111111111111111111111100000066.json?bits=5024

response: {"return":"succ","client":{"ip":"192.168.131.30","sp":"0","loc":"0"},"playlist":[{"bits":"4060","tname":"super-dvd","size":"90000500","urls":["http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4","http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"]}]}


and i want :


{

 return: "succ",
 client: {
   ip: "192.168.131.30",
   sp: "0",
   loc: "0"
 },
 playlist: [
   {
     bits: "4060",
     tname: "super-dvd",
     size: "90000500",
     urls: [
       "http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4",
       "http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"
     ]
   }
 ]

}

when: http://192.168.16.131:6900/query/v1/mp4/11111111111111111111111100000066.json?bits=5024 response: {"return":"succ","client":{"ip":"192.168.131.30","sp":"0","loc":"0"},"playlist":[{"bits":"4060","tname":"super-dvd","size":"90000500","urls":["http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4","http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"]}]} and i want : { return: "succ", client: { ip: "192.168.131.30", sp: "0", loc: "0" }, playlist: [ { bits: "4060", tname: "super-dvd", size: "90000500", urls: [ "http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4", "http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4" ] } ] }

모든 댓글 (2)

more options

You're doing this in JavaScript, or just opening it directly in Firefox?

Generally speaking, text files like JSON responses do not have any associated style sheet and Firefox just displays them as received. To pretty it up, you probably need to retrieve it with a script that generates an HTML page from it. Perhaps there is an add-on for that?

more options