只是好奇之前是否有人设置过 CodeMirror 并让 onLoad 函数工作。使用最新版本,它无法正常工作。这是我的代码:
cydonia.editor = CodeMirror.fromTextArea('query', {
height: $('#query-text-space').css('height'),
parserfile: ["tokenizexquery.js", "parsexquery.js" ],
stylesheet: ["/common/codemirror/css/xmlcolors.css", "/common/codemirror/css/xqcolors.css"],
path: "/common/codemirror/js/",
continuousScanning: false, //500,
lineNumbers: true,
onLoad: function (n) {
alert('loaded');
}
});
谢谢!!!