I want to display textarea as CKEditor but it's not working in here, although it works in my html code.
I have a file global.js which I have included in my html code too as a script.
This is my function in global.js
$(document).ready(function() {
$("a#reply").one("click" , function() {
var comCode = $(this).attr("name");
var parent = $(this).parent();
parent.append("<br /><form action='index.php' method='post'><input
type='text' name='uname2' id='uname2' placeholder='Enter username'
required /><textarea class='ckeditor' name='editor'
placeholder='Enter your query' id='new-reply' required></textarea>
<input type='hidden' name='code' value='"+comCode+"' /><input
type='submit' class='form-submit' id='form-reply' name='new_reply'
value='Reply' /></form>")
//$(".chreply").toggle();
});
})
I even tried including:
CKEDITOR.scriptLoader.load( this.path + 'ckeditor/ckeditor.js' );
CKEDITOR.replace( 'ckeditor' );
Am I doing something wrong? Is it a problem with my code or else is it that ckeditor is never displayed in js files ?
It works by adding
parent.append("<br /><form action='index.php' method='post' id='tog'><input
type='text' name='uname2' id='uname2' placeholder='Name' required /><textarea
name='editor' placeholder='Query' id='new-reply' required>
</textarea><input type='hidden' name='code' value='"+comCode+"' /><input
type='submit' class='form-submit' id='form-reply' name='new_reply'
value='Reply' /><script>CKEDITOR.replace('new-reply');</script></form>")