🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

A lightweight, simple, beautiful JSON viewer and editor plugin helps the developers to render JSON objects in HTML with collapsible/expandable navigation just like a tree view.

json JSON-viewer JSON-Editor

Documentation

jquery.json-editor

A json editor based on jquery.json-viewer.

Check out the demo page!

特性:

  • 语法高亮
  • 支持数据块展开与收起
  • 简单
  • 可编辑

使用

<script src="path/to/jquery.js" type="text/javascript"></script> <script src="path/to/jquery.json-editor.js" type="text/javascript"></script>
/**  * 初始化一个 JsonEditor  *  * @param {DOM|string} container DOM 元素或 jQuery 选择器字符串  * @param {Object} json JSON 对象  * @param {Object=} options 其他配置项,可选  * @param {boolean} options.defaultCollapsed 是否默认是收起状态,默认 false  * @param {boolean} options.editable 是否可编辑,默认 true  */ var editor = new JsonEditor(container, json, options);  // 更新 json editor.load(json);  // 获取 json try {     editor.get(); } catch (ex) {     // Trigger an Error when JSON invalid     alert(ex); }

You May Also Like