jdorn /json-editor

JSON Schema Based Editor

★ 5,810⑂ 1,060👁 215⑃ 196● 655▤ 41
JavaScriptMITCreated 2013-11-25
下载:JSON Editor 0.7.28JSON-0.7.28 ↓0.7.282016-08-07
+0
日增长
5,810
stars
1,060
forks
215
watchers
196
prs
655
issues
41
releases

README

Deprecation notice

This repo is no longer maintained (see also https://github.com/jdorn/json-editor/issues/800)

Development is continued at https://github.com/json-editor/json-editor

For details please visit https://github.com/json-editor/json-editor/issues/5

---

JSON Editor
===========

!JSON Schema - HTML Editor - JSON

JSON Editor takes a JSON Schema and uses it to generate an HTML form.  
It has full support for JSON Schema version 3 and 4 and can integrate with several popular CSS frameworks (bootstrap, foundation, and jQueryUI).

Check out an interactive demo (demo.html): http://jeremydorn.com/json-editor/

Download the [production version][min] (22K when gzipped) or the [development version][max].

[min]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.min.js
[max]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.js

Requirements
-----------------

JSON Editor has no dependencies. It only needs a modern browser (tested in Chrome and Firefox).

 Optional Requirements

The following are not required, but can improve the style and usability of JSON Editor when present.

  A compatible JS template engine (Mustache, Underscore, Hogan, Handlebars, Swig, Markup, or EJS)
  A compatible CSS framework for styling (bootstrap 2/3, foundation 3/4/5, or jqueryui)
  A compatible icon library (bootstrap 2/3 glyphicons, foundation icons 2/3, jqueryui, or font awesome 3/4)
  SCEditor for WYSIWYG editing of HTML or BBCode content
  EpicEditor for editing of Markdown content
  Ace Editor for editing code
  Select2 for nicer Select boxes
  Selectize for nicer Select & Array boxes
  math.js for more accurate floating point math (multipleOf, divisibleBy, etc.)

Usage
--------------

If you learn best by example, check these out:

  Basic Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/basic.html
  Advanced Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/advanced.html
  CSS Integration Example - http://rawgithub.com/jdorn/json-editor/master/examples/css_integration.html

The rest of this README contains detailed documentation about every aspect of JSON Editor.  For more under-the-hood documentation, check the wiki.

 Initialize

js
var element = document.getElementById('editor_holder');

var editor = new JSONEditor(element, options);


 Options

Options can be set globally or on a per-instance basis during instantiation.

js
// Set an option globally
JSONEditor.defaults.options.theme = 'bootstrap2';

// Set an option during instantiation
var editor = new JSONEditor(element, {
  //...
  theme: 'bootstrap2'
});


Here are all the available options:


  
  
    Option
    Description
    Default Value
  
  
  
  
    ajax
    If true, JSON Editor will load external URLs in $ref via ajax.
    false
  
  
    disable_array_add
    If true, remove all "add row" buttons from arrays.
    false
  
  
    disable_array_delete
    If true, remove all "delete row" buttons from arrays.
    fals

Top issues

Latest release

JSON Editor 0.7.28 v0.7.28 2016-08-07
Changelog
-  Add support for enum_titles with mutliselect editor
-  Bug fix: array add-remove-add deleted non-required properties
-  Bug fix: this.translate not a function

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON