2
、通过 IFRAME 调用
以下为引用的内容:
<Form name="frm1">
<INPUT name="myFCKeditor" id="myFCKeditor" style="DISPLAY: none" type=hidden>
<INPUT id="myFCKeditor___Config" style="DISPLAY: none" type=hidden>
<IFRAME id="myFCKeditor___Frame" src="FCKeditor/editor/fckeditor.html?
InstanceName=myFCKeditor&Toolbar=Default" frameBorder=0 width=100% scrolling=no
height=300>
</IFRAME>
</Form>
注意:name="myFCKeditor"
和 IFRAME
中 InstanceName=myFCKeditor “
的 myFCKeditor”
必须相同。
其实,用 IFRAME 调用和用第一种方法本质是完全一样的!不信的话,请在用浏览器打
开网站上的 index.php
“
”
文件,然后查看 源代码 ,就是本 IFRAME 调用的代码。所以推荐
通过创建实例来调用。
3
、当用 Javascript 来获得内容的时候是不是发现得不到内容,如:
<script>
<input type=button onclick="alert(document.all.frm1.myFCKeditor.value);" value="GetHtml">
</script>
你会发现弹谈出的窗口没内容。
我们可以通过下面的代码来获得它的内容:
以下为引用的内容:
<script>
function getContentValue()
{
var oEditor = FCKeditorAPI.GetInstance('myFCKeditor');
var acontent = oEditor.GetXHTML();
return acontent;
}
</script>
<input type=button onclick="alert(getContentValue());">
二、配置一些文件
1、fckconfig.js 的配置
(1)工具按钮设置
查找 FCKConfig.ToolbarSets["Default"],这里有很多按钮,下面我们将对他们详细介绍