首页 > 代码库 > json-view
json-view
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8" /> <title>JQuery JSONView</title> <link rel="stylesheet" href="http://www.mamicode.com/jquery.jsonview.css" /> <script type="text/javascript" src=http://www.mamicode.com/"http://code.jquery.com/jquery.min.js"></script> <script type="text/javascript" src="http://www.mamicode.com/jquery.jsonview.js"></script> <script type="text/javascript"> var json = { "hey": "guy", "anumber": 243, "anobject": { "whoa": "nuts", "anarray": [1, 2, "thr<h1>ee"], "more": "stuff" }, "awesome": true, "bogus": false, "meaning": null, "japanese": "永远的明天。", "link": "http://jsonview.com", "notLink": "http://jsonview.com是很棒的", "multiline": [ ‘像我一样,你可以向前走,‘, ‘走下坡路走.‘, ‘嗯,我也把我放下了.‘, ‘路人,请停在这里.‘ ].join("\n") }; var allJson = { "id": 61891, "subLemmaId": 14022133, "newLemmaId": 1122445, "key": "中国", "desc": "世界四大文明古国之一", "title": "中国", "card": [ { "key": "m7_nameC", "name": "中文名称", "value": [ "中国" ], "format": [ "中国" ] }, { "key": "m7_nameE", "name": "英文名称", "value": [ "China" ], "format": [ "China" ] }, { "key": "m7_nameOther", "name": "简称", "value": [ "华、夏" ], "format": [ "华、夏" ] }, { "key": "m7_continent", "name": "所属洲", "value": [ "亚洲" ], "format": [ "亚洲" ] }, { "key": "m7_country1", "name": "首都", "value": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E9%95%BF%E5%AE%89/31540\" data-lemmaid=\"31540\">长安</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E6%B4%9B%E9%98%B3/125712\" data-lemmaid=\"125712\">洛阳</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E5%8D%97%E4%BA%AC/23952\" data-lemmaid=\"23952\">南京</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E5%8C%97%E4%BA%AC/128981\" data-lemmaid=\"128981\">北京</a>等" ], "format": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E9%95%BF%E5%AE%89/31540\" data-lemmaid=\"31540\">长安</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E6%B4%9B%E9%98%B3/125712\" data-lemmaid=\"125712\">洛阳</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E5%8D%97%E4%BA%AC/23952\" data-lemmaid=\"23952\">南京</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E5%8C%97%E4%BA%AC/128981\" data-lemmaid=\"128981\">北京</a>等" ] }, { "key": "m7_country6", "name": "官方语言", "value": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E6%B1%89%E8%AF%AD\">汉语</a>" ], "format": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E6%B1%89%E8%AF%AD\">汉语</a>" ] }, { "key": "m7_country12", "name": "主要民族", "value": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E6%B1%89%E6%97%8F\">汉族</a>" ], "format": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E6%B1%89%E6%97%8F\">汉族</a>" ] }, { "key": "m7_country13", "name": "主要宗教", "value": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E5%84%92%E6%95%99\">儒教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E4%BD%9B%E6%95%99\">佛教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E9%81%93%E6%95%99\">道教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E4%BC%8A%E6%96%AF%E5%85%B0%E6%95%99\">伊斯兰教</a>" ], "format": [ "<a target=_blank href=http://www.mamicode.com/"/item/%E5%84%92%E6%95%99\">儒教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E4%BD%9B%E6%95%99\">佛教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E9%81%93%E6%95%99\">道教</a>、<a target=_blank href=http://www.mamicode.com/"/item/%E4%BC%8A%E6%96%AF%E5%85%B0%E6%95%99\">伊斯兰教</a>" ] }, { "key": "m7_ext_0", "name": "通用文字", "value": [