fehelper_jsonformat.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE HTML>
  2. <html lang="zh-CN">
  3. <head>
  4. <title>Json格式化查看工具</title>
  5. <meta charset="UTF-8">
  6. <link rel="stylesheet" href="../static/css/fe-jsonformat.css" />
  7. <script type="text/javascript" src="../static/js/core/jquery-1.5.min.js"></script>
  8. <script type="text/javascript" src="../static/js/mod/mod_jsonformat.js"></script>
  9. </head>
  10. <body>
  11. <div class="wrapper wp-json">
  12. <div class="panel panel-default" style="margin-bottom: 0px;">
  13. <div class="panel-heading">
  14. <h3 class="panel-title">
  15. <a href="http://www.baidufe.com/fehelper/feedback.html" target="_blank" class="x-a-high">
  16. <img src="../static/img/fe-16.png" alt="fehelper"/> FeHelper</a>:JSON格式化查看
  17. <span class="x-xdemo">示例1:JSON片段</span>
  18. <a class="x-xdemo" href="https://www.sojson.com/open/api/weather/json.shtml?city=%E5%8C%97%E4%BA%AC" target="_blank">示例2:在线JSON-1</a>
  19. <a class="x-xdemo" href="https://suggest.taobao.com/sug?code=utf-8&q=iphonex&callback=thisIsACallbackFunction" target="_blank">示例3:在线JSON-2</a></h3>
  20. <textarea name="demo" id="demo" cols="30" rows="10" class="hide">
  21. {
  22. "date": "20180322",
  23. "message": "Success !",
  24. "status": 200,
  25. "city": "北京",
  26. "count": 632,
  27. "data": {
  28. "shidu": "34%",
  29. "pm25": 73,
  30. "pm10": 91,
  31. "quality": "良",
  32. "wendu": "5",
  33. "ganmao": "极少数敏感人群应减少户外活动",
  34. "yesterday": {
  35. "date": "21日星期三",
  36. "sunrise": "06:19",
  37. "high": "高温 11.0℃",
  38. "low": "低温 1.0℃",
  39. "sunset": "18:26",
  40. "aqi": 85,
  41. "fx": "南风",
  42. "fl": "<3级",
  43. "type": "多云",
  44. "notice": "阴晴之间,谨防紫外线侵扰"
  45. },
  46. "forecast": [
  47. {
  48. "date": "22日星期四",
  49. "sunrise": "06:17",
  50. "high": "高温 17.0℃",
  51. "low": "低温 1.0℃",
  52. "sunset": "18:27",
  53. "aqi": 98,
  54. "fx": "西南风",
  55. "fl": "<3级",
  56. "type": "晴",
  57. "notice": "愿你拥有比阳光明媚的心情"
  58. },
  59. {
  60. "date": "23日星期五",
  61. "sunrise": "06:16",
  62. "high": "高温 18.0℃",
  63. "low": "低温 5.0℃",
  64. "sunset": "18:28",
  65. "aqi": 118,
  66. "fx": "无持续风向",
  67. "fl": "<3级",
  68. "type": "多云",
  69. "notice": "阴晴之间,谨防紫外线侵扰"
  70. },
  71. {
  72. "date": "24日星期六",
  73. "sunrise": "06:14",
  74. "high": "高温 21.0℃",
  75. "low": "低温 7.0℃",
  76. "sunset": "18:29",
  77. "aqi": 52,
  78. "fx": "西南风",
  79. "fl": "<3级",
  80. "type": "晴",
  81. "notice": "愿你拥有比阳光明媚的心情"
  82. },
  83. {
  84. "date": "25日星期日",
  85. "sunrise": "06:13",
  86. "high": "高温 22.0℃",
  87. "low": "低温 7.0℃",
  88. "sunset": "18:30",
  89. "aqi": 71,
  90. "fx": "西南风",
  91. "fl": "<3级",
  92. "type": "晴",
  93. "notice": "愿你拥有比阳光明媚的心情"
  94. },
  95. {
  96. "date": "26日星期一",
  97. "sunrise": "06:11",
  98. "high": "高温 21.0℃",
  99. "low": "低温 8.0℃",
  100. "sunset": "18:31",
  101. "aqi": 97,
  102. "fx": "西南风",
  103. "fl": "<3级",
  104. "type": "多云",
  105. "notice": "阴晴之间,谨防紫外线侵扰"
  106. }
  107. ]
  108. }
  109. }</textarea>
  110. </div>
  111. </div>
  112. <div class="panel-body mod-json">
  113. <div class="row panel-txt">
  114. <textarea class="form-control mod-textarea" id="jsonSource" placeholder="在这里粘贴您需要进行格式化的JSON代码"></textarea>
  115. <div><button id="btnFormat" class="btn btn-primary ui-mt-10">格式化</button><span id="errorMsg"></span></div>
  116. </div>
  117. <div class="row rst-item" id="modJsonResult">
  118. <div id="formattingMsg">
  119. <svg id="spinner" width="16" height="16" viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg" version="1.1">
  120. <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a -100,-100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6"></path>
  121. </svg>
  122. 加载中...
  123. </div>
  124. <div id="jfCallbackName_start" class="callback-name"></div>
  125. <div id="jfContent">
  126. <div class="x-placeholder">
  127. <img src="../static/img/json-demo.jpg" alt="json-placeholder">
  128. </div>
  129. </div>
  130. <pre id="jfContent_pre"></pre>
  131. <div id="jfCallbackName_end" class="callback-name"></div>
  132. </div>
  133. </div>
  134. </div>
  135. </body>
  136. </html>