Search code examples
ajaxnicedit

prob when loading nicedit with ajax call


i'm using nicedit.js to convert my textarea to html editor, when i call the directly the page there is no prob, but when i call via ajax call, or call page which under jquery tab, the editor page not load but pop error,

Error: 'null' is null or not an object

i declare my textarea as below

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');
});

anyone has use nicedit with ajax

thanks in advance


Solution

  • after cracking my head, finally i found solution, so when ever call page which contain editor via ajax, just declare the textarea as new nicEditor().panelInstance('content');

    not bkLib.onDomLoaded(function() { new nicEditor().panelInstance('content'); }