The App: I have a textarea element in my page. It is transformed using CodeMirror, because I need to indent and highlight html code withing it. Pic is in the li
onChange handling in code mirror is not like this :
onChange: function(cm) { mySecondTextArea.value = cm.getValue(); }
you have to use :
$.fn.buildCodeMirror = function(){
var cmOption {...};
var cm = CodeMirror($("MyDomObjectSelector")[0],cmOption);
cm.on("change",$.fn.cmChange);
}
$.fn.cmChange = function(cm,cmChangeObject){
alert("code mirror content has changed");
}