NicEditor not working ReferenceError: bkLib

I got a problem with my NicEditor. If I use a simple html page which is like this:

<html>
<head>
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
</head>
<body>
<textarea></textarea>
</body>
</html>

Which is okay. But what happens is im using a index.page which has a navigation pane and a DIV container pane which will be change after I selected a menu in the navigation pane using this code

$('table#messages tr td a').click(function(){
    //Content Manipulation
    var page = $(this).attr('href');
    page = page.replace('#','');
    $('#content').load('message.details.php?messageid='+page);

    return false;
});

I tried to include the NicEditor Script in the index.php but it seems the <textarea> of the message.detail.php was not converted into NicEditor. I also tried to include NicEditor Script to the message.detail.php but it gives an error of "Uncaught ReferenceError: bkLib is not defined"

Message Detail Page

<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

<div class="span9 pull-right">
    <div class="hero-unit">
        <textarea></textarea>
    </div>
</div>

I hope you understand what I'm trying to say.

Answers


Try re-initializing NicEditor after loading the textarea, such as:

$('table#messages tr td a').click(function(){
//Content Manipulation
var page = $(this).attr('href');
page = page.replace('#','');
$('#content').load('message.details.php?messageid='+page);

// Set new textareas to use NicEditor
bkLib.onDomLoaded(nicEditors.allTextAreas);

return false;

});


Need Your Help

Get history of a Deleted File from SVN using SVNKit

java svn svnkit

I am trying to access Revision History of a file that has been deleted using SVNKit.

How to use string without double quotes around it via Javascript?

javascript jquery

I have a very small problem but couldn't find the solution despite of 2 hours of searching.