In my TinyMCE.init method, I have a setup function like this one :
setup: function(ed){
ed.onKeyUp.add(function(ed, e){
var count = ed.getBody().innerText.length;
var key = e.keyCode || e.charCode;
console.log(count);
console.log(ed.getBody().innerText);
});
}
If my textarea is empty, when I press Backspace (key = 8), count equals 0. When I press Delete (key = 46), count equals 1.
In both cases, console.log(ed.getBody().innerText);
returns an empty string.
I want to use this to count (and limit) the size of my TinyMCE. Does anyone can illuminate me about that strange difference ?