Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dblate/jquery.json-editor

A json editor based on jquery.json-viewer.
https://github.com/dblate/jquery.json-editor

json json-editor json-viewer jsoneditor jsonviewer

Last synced: 12 days ago
JSON representation

A json editor based on jquery.json-viewer.

Awesome Lists containing this project

README

        

# jquery.json-editor
A json editor based on [jquery.json-viewer](https://github.com/abodelot/jquery.json-viewer).

Check out the [demo page](https://dblate.github.io/jquery.json-editor/)!

## 特性:

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

## 使用

```html

```

```javascript
/**
* 初始化一个 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);
}
```

## License

MIT License