visual JSON editor with comments
fork from Vue-Json-Edit
<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>
- 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
}