Skip to content
saberma edited this page Sep 24, 2011 · 1 revision

语法高亮

src/ace.js中只带了文本、括号匹配等语法模块
还需要添加html,javascript,css等语法模块

<script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>

实例化编辑器后调用

var JavaScriptMode = require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode());
Clone this wiki locally