CodeMirror htmlmixed mode breaks-Collection of common programming errors
I’m building a mobile web application with jQuery Mobile and CodeMirror. But since I’m trying to use htmlmixed mode, I’m having troubles. (With css mode or js mode it works perfectly)
TypeError: 'undefined' is not a function (evaluating 'htmlMode.startState()') in htmlmixed.js:72
Does anybody know how to debug this? I tried for hours. I commented out this line, I inspected the htmlMode
object, searched with DuckDuckGo and Google… No luck.
These are the lines with which I’m loading CodeMirror:
And so I’m initializing CodeMirror:
$(document).on("pageinit","#asite",function (){
var mirror = CodeMirror.fromTextArea(document.getElementById("dateifeld"),{
lineNumbers: true,
mode: "text/html",
lineWrapping: true
});
});
Here is the relevant HTML:
Edit: Got it! The problem was that I didn’t included the XML script. (CodeMirror HTML mode not working)