当我用这个脚本初始化nicEdit时:
脚本1
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });我的文本区域仍然是默认的,然后我添加了这个脚本:
脚本2
$(document).ready(function() {
nicEditors.allTextAreas();这是工作,但是第一个脚本的作用是什么?因为虽然我只使用了第二个脚本,但它的工作
这就是我的问题:D在我成功初始化nicEdit后,我在新的div中再次创建新的文本区域(我再次编写脚本1和2),然后firebug说“A.removeInstance不是一个函数”。
帮帮我,师父
我只是个新手
发布于 2012-07-24 04:58:10
在niceEdit.js中,将checkReplace函数替换为以下内容:
checkReplace : function(e) {
var r;
var editors = nicEditors.editors;
for(var i=0;i<editors.length;i++) {
if(editors[i].instanceById(e)) {
r = editors[i]; // r is an instance of nicEditorInstance therefore it does not have removeInstance or removePanel methods
break;
}
}
if(r) {
r.removeInstance(e);
r.removePanel();
}
return e;
}发布于 2011-11-15 19:51:27
试试来自https://github.com/danishkhan/NicEdit/downloads的更新版本--它是从2010年9月开始的。他的网站上的版本是在4月创建的。
在他的github网站上,你可以在顶部看到一条评论:“修复了removeInstance错误:R是nicEditorInstance(或nicE)的一个实例”
也许这会对你有帮助--我整个上午都在修复一个已经修复的bug,因为我不知道这个=)
https://stackoverflow.com/questions/7978300
复制相似问题