问题描述
function FCKeditor_OnComplete(editorInstance){ editorInstance.Events.AttachEvent("OnFocus",FCKeditor_OnFocus); }function FCKeditor_OnFocus(editorInstance){parent.insert("frame");} 使用FCK后,想在FCK获得光标的时候,做一些事情,于是用到了FCKeditor_OnComplete这个方法,但是为什么下面的这个在FF下不能运行呢editorInstance.Events.AttachEvent("OnFocus",FCKeditor_OnFocus);
解决方案
ff下注册事件用addEventListenervar o=editorInstance.EditorDocument;if(o.attachEvent){o.attachEvent("onfocus",FCKeditor_OnFocus);}else{o.addEventListener("focus",FCKeditor_OnFocus,false);}
时间: 2024-06-11 05:00:38