Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/dblate/jquery.json-editor
- Owner: dblate
- Created: 2018-05-24T17:26:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T08:00:51.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T07:47:56.975Z (23 days ago)
- Topics: json, json-editor, json-viewer, jsoneditor, jsonviewer
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 39
- Watchers: 2
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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