I do n’t say much nonsense, I will post code directly. The specific code is shown below:
<! Doctype html> <html> <wead> <meta charset = UTF-8> <Title> js bin </title> <link rel = styleSheet href = https: //rawgithub.com/yesmeck/jquery-json view/master /dist/jquery.jsonView.css/> <script type = text/javascript src = http: //code.jqury.com/jqury.min.js> </script> IPT SRC = https: //rawgithub.com/yesmeck/jquery-jsonView/master/dist/jqury.jsonView.js> </script> <script type = text/javascript> var json = {hey: guy, anumbor : 243, anObject: {WHOA : Nuts, Anarray: [1,2, THR <H1> EE], Anotheraray: [1, 2], More: Stuff}, AWESOME: TRUE, Bogus: False, Meaning: Null, Japanese: Tomorrow. , link: http://jsonview.com, notlink: http://jsonview.com is great}; $ (function () {$ ('#json'). JsonView (json); ') .on (' CLICK ', Function () {$ ('#json '). JsonView (' Collapse ');}); {$ ('#json'). JsonView ('Expand');}); Toggle ');}); $ ('#Toggle-level1-btn '). On (' click ', function () {$ ('#json '). JsonView (' Toggle ', 1);}); ('#Toggle-level2-btn'). On ('click', function () {$ ('#json'). JsonView ('Toggle', 2);}); Head> <body> <br/> <Button ID = Collapse-BTN> COLLAPSE </Button> <Button ID = Expand-BTN> Expand </Button> <Button ID = Toggle-BTN> Toggle </Button> TTON ID = Toggle-Level1-BTN> Toggle Level1 </Button> <Button ID = Toggle-Level2-BTN> Toggle Level2 </Button> <Div ID = JSON> </DIV> </Html>
As Demo shows, the formatting JSON
The above is the instance code of the HTML formatting JSON introduced by Xiaobian. I hope it will be helpful to everyone. If you have any questions, please leave me a message. Xiaobian will reply to everyone in time. Thank you very much for your support for the VEVB Wulin website!