I have a div with contenteditable that should run paste on “enter.” Everything works fine in IE, but Firefox is driving me crazy.
this.e.keydown(function(event) {
if(event.keyCode == 13) {
var execute = editor.insertHTML(\'<br />\')';
eval(execute);
return false;
}
});
Firefox ignores the end of the div, and I think the beginning too. So if I press enter in the middle of the sentence, it works as it should. Trying to do the same at the end of the sentence (the very last) he fails.
Any ideas? The same problem as in the preview editor stackoverflow : -)
Press "enter" at the end> crash ... press "enter" one letter earlier> newline
Thom source
share