I have:
<script type="text/javascript">
$(function() {
var id = '<%=txtEditor.ClientID%>';
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
mode: "application/xml",
lineNumbers: true,
buttons : ['undo','redo'],
onCursorActivity: function() {
editor.setLineClass(hlLine, null);
hlLine = editor.setLineClass(editor.getCursor().line, "activeline");
}
});
var hlLine = editor.setLineClass(0, "activeline");
});
</script>
Code works fine but unable to highlight syntax and button is not appear.Am i missing something.Thanks.
There’s is on
buttonsoption in CodeMirror. If things don’t highlight, you probably forgot to include a stylesheet.