2011-03-28 23 views
2

我使用nicedit.js将我的textarea转换为html编辑器,当我直接调用页面没有概率,但是当我通过ajax调用调用,或调用页面下jQuery的标签,编辑页面没有加载,但弹出错误,概述当加载nicedit与ajax调用

错误:“空”为空或不是对象

我宣布我的textarea如下

bkLib.onDomLoaded(function() { 
    new nicEditor({iconsPath :'<%=request.getContextPath()%>/images/nicEditorIcons.gif', 
    maxHeight:345, 
    buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','xhtml']}).panelInstance('content'); 
}); 

任何人有使用nicedit阿贾克斯

在此先感谢

回答

6

破解我的头后,终于让我找到解决办法,所以当调用过含有通过AJAX编辑页面,只需要声明的文本区域作为 新nicEditor()panelInstance(“内容”)。

不 bkLib.onDomLoaded(函数(){ 新nicEditor()panelInstance( '内容');}

3

我使用

new nicEditors.allTextAreas; 

代替

bkLib.onDomLoaded(nicEditors.allTextAreas);