高分跪求:javascript取带kindEditor的textarea怎么为空???高人帮看一下,!! 我是用这样取值的:document.getElementById("question").value,但是取出来的结果很遗憾为空!怎么解决啊?难道用kindEditor就不能取值了吗???我纠结了1天了,麻烦大家解决一下,小的太笨,详细点吧,嘻嘻~~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 看文档啊,要用editor对象实例的html()取值:var html = editor.html(); //这里的editor替换为你创建的KEditor对象实例名称 直接取textarea的值,如果取不道就得同步一下。kindEditor 4.0之后能自动同步,不过那是在form提交的时候自动的,平常要取貌似要手动一下。仔细的看一下 kindEditor 的文档。var editor;KindEditor.ready(function(K) { editor = K.create('#editor_id');});// 取得HTML内容html = editor.html();// 同步数据后可以直接取得textarea的valueeditor.sync();html = document.getElementById('editor_id').value; // 原生APIhtml = K('#editor_id').val(); // KindEditor Node APIhtml = $('#editor_id').val(); // jQuery// 设置HTML内容editor.html('HTML内容'); KindEditor 在线 apihttp://www.kindsoft.net/docs/index.html刚才的方法出自:http://www.kindsoft.net/docs/usage.html 如何转成金钱格式 关于设置div层的隐藏 请帮我看看。ASP2JAVASCRIPT JavaScript 新手入门题。。。 什么地方错了 弹出的POP窗口 模拟QQ菜单,还有错误,实在"编"不下去,高手过来帮着改改 关于再HTC中EXPOSE METHOD的疑问! 如何使一个层具有模式窗口的效果 ???:当我选中第一个下拉框中的某个元素时,另一个下拉框则显示相关的几个选项?--谢谢! js,正则,高手请进! chrome下js代码失效,求助
var html = editor.html(); //这里的editor替换为你创建的KEditor对象实例名称
KindEditor.ready(function(K) {
editor = K.create('#editor_id');
});
// 取得HTML内容
html = editor.html();// 同步数据后可以直接取得textarea的value
editor.sync();
html = document.getElementById('editor_id').value; // 原生API
html = K('#editor_id').val(); // KindEditor Node API
html = $('#editor_id').val(); // jQuery// 设置HTML内容
editor.html('HTML内容');
http://www.kindsoft.net/docs/index.html
刚才的方法出自:
http://www.kindsoft.net/docs/usage.html