Sha256: 5094c8f5f5c2898a1cbae3bf13c979f9511ae30aa87b550d2e7b2b62b0ddf9e8

Contents?: true

Size: 646 Bytes

Versions: 3

Compression:

Stored size: 646 Bytes

Contents

var module = '../../../dist/jsoneditor';
require([module], function (JSONEditor) {
  // create the editor
  var container = document.getElementById('jsoneditor');
  var editor = new JSONEditor(container);

  // set json
  document.getElementById('setJSON').onclick = function () {
    var json = {
      'array': [1, 2, 3],
      'boolean': true,
      'null': null,
      'number': 123,
      'object': {'a': 'b', 'c': 'd'},
      'string': 'Hello World'
    };
    editor.set(json);
  };

  // get json
  document.getElementById('getJSON').onclick = function () {
    var json = editor.get();
    alert(JSON.stringify(json, null, 2));
  };
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
statixite-1.0.2 vendor/assets/bower_components/jsoneditor/examples/requirejs_demo/scripts/main.js
statixite-1.0.1 vendor/assets/bower_components/jsoneditor/examples/requirejs_demo/scripts/main.js
statixite-1.0.0 vendor/assets/bower_components/jsoneditor/examples/requirejs_demo/scripts/main.js