Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1014 Bytes

File metadata and controls

64 lines (45 loc) · 1014 Bytes

JSON textarea

visual JSON editor with comments

fork from Vue-Json-Edit

Online Demo

Usage

<textarea name="hello" class="json_editor">
    [1, 2, 3, "Hello"]
</textarea>

<script src="path/of/json-textarea.js"></script>
  

OR

<textarea name="json" class="my-class">
    [1, 2, 3, "Hello"]
</textarea>

<script src="path/of/json-textarea.js"></script>
<script>
    JSONTextArea.Launcher.init(".my-class", {
        comments: {}, //comments data
        /**
         * comments save callback
         **/
        updateComments: function(e) {
            //do something
        }
    })
</script>
  

Options

  • comments:
{
    "json path": "comments text"
    //....
}
  • updateComments:
updateComments : function (e) {
    console.log(e.key); //JSON path
    console.log(e.comments); //comments text
    console.log(e.target); //textarea element
}