Kind Editor Documentation

FAQ

Kind editor is in UTF-8 encoded. Can I use it within some other encoding web page?
Yes, the simplest way to define charset to utf-8 when import kindeditor.js.
<script type="text/javascript" charset="utf-8" src="/editor/kindeditor.js">script>
Nothing happens when I load editor via ajax way.
You need to know difference between KE.show and KE.create. If KE.show called, KE.init will be executed first. When DOM is ready, KE.create will be executed. If event DOMContentLoaded is not fired, for example, via ajax. At this time, DOM has been ready, KE.create will not be reached. You may need to call KE.init and KE.create one by one.
KE.init({
    id
: 'textarea_id'
});
KE
.create('textarea_id');
Why some HTML tags get losed?
Please check if you have set filterMode to true. Turning it off will help you out.
KE.show({
    id
: 'textarea_id',
    filterMode
: true // true: filter on, false:filter off
});
Kind editor doesn't work. It seems that its CSS style conflicts with mine.
The root cause may be that your global css selector overwrite kind editor's.
Solution is define these conflicted selector (for example, div/table/td) twice. Firstly, put skins/default.css import declaration after your css file, then define selectors again after declaration.
<style>
/* your CSS definition */
img
{
    border
: 1px solid #555555;
    padding
: 10px;
}
style>


<link rel="stylesheet" type="text/css" href="./skins/oxygen.css" />

<style>
/* redefine conflicted CSS */
img
{
    border
: 0;
    padding
: 0;
}
style>


<script>
KE.show({
    id : 'textarea_id',
    loadStyleMode : false
});
scirpt>
Error occurs with image inserting/hyper link being clicking on with cross-domain-loaded editor.
These operations will call out of pop window, which is implemented with iframe. Different domain within iframe will lead to javascript security exception.
One solution is using postMessage, which is not supported by IE6/IE7.
Another way is to reimplement KE.dialog without iframe.
I can't get HTML slice generated by editor. I get nothing from value of textarea.
Please call KE.util.setData() before reference to TEXTAREA.Value.
By default, kind editor will call KE.util.setData() automatically within onsubmit event of form.
//fill HTML generated back to textarea
KE
.util.setData(id);

//KE.util.setData equals the following code
KE
.g[id].srcTextarea.value = KE.util.getData(id);