我想以json格式显示文本,但未通过使用'application / ld + json'模式显示
以下是我的代码:_
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
mode:'application/ld+json',
theme: 'eclipse',
matchBrackets :'true',
lineNumbers : 'true',
lineWrapping : 'true',
autoCloseBrackets: 'true'
});
editor.on('inputRead', function (a, b) {
editor.save();
});
editor.on('onInput', function (a, b) {
editor.save();
});