从此后面的:TinyMCE editor fixed size with no scrollers?tinyMCE:删除最后插入的代码
如何删除tinyMCE中最后插入的代码?
setup : function(ed){
ed.onKeyDown.add(function (ed, evt) {
var currentfr=document.getElementById(ed.id + '_ifr');
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight + 26;
}
else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
}
if(currentfr.height >= 156){
// Remove last inserted code here
}
});
},
所以,如果身高是156或更高,它应该删除你刚输入的内容(代码)。
我怎样才能做到这一点?
+1很好的问题 – Thariama