原先控件的editfunc.js中的代码注掉了很多,删除掉了作为get方式传递的TextArea对象。
我是用的动态生成方式,通过点击按钮生成HtmlEditor:
代码如下:
//containername:存放iframe的容器名称 framename:HtmlEditor的iframe名称 editorpath:编辑器index.html的路径 function createEditor(containername,framename,editorpath) { if(!document.getElementById(framename)) { var HTMLEDITOR = document.createElement("iframe"); HTMLEDITOR.id = framename; HTMLEDITOR.name = framename; HTMLEDITOR.src = editorpath; HTMLEDITOR.frameBorder = "0"; HTMLEDITOR.marginHeight = "0"; HTMLEDITOR.marginWidth = "0"; HTMLEDITOR.height = "238"; HTMLEDITOR.width = "400"; document.getElementById(containername).appendChild(HTMLEDITOR); } }
设置HtmlEditor的值的代码:
获得HtmlEditor的值的代码: