//首先在HEAD區(qū)加入要引用的JS
<head>
<script type="text/javascript" src="FCKEditor/fckeditor.js"></script>
<script type="text/javascript" language="javascript">
function check()
{
// 取得FCKEditor的值,GetInstance(arg),這里的參數(shù)arg是FCKeditor實(shí)例名;
//如聲明FCKeditor用var oFCKeditor = new FCKeditor('FCKEditor1',500,200,'Board'),則此時(shí)arg就是FCKEditor1;
var checkContent1 =FCKeditorAPI.GetInstance("FCKEditor1").GetXHTML();
if (checkContent1 == "")
{
strErr += '評(píng)論內(nèi)容不能為空!\n\n';
alert(strErr);
}
}
</script>
</head>
<%-- 把這段寫在需要顯示FCKEditor編輯框的地方 --%>
<div class="FCKeditor">
<script type="text/javascript">
var sBasePath = "FCKEditor/";
var oFCKeditor = new FCKeditor('FCKEditor1',500,200,'Board'); //實(shí)例名為FCKEditor1
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Create() ;
</script>
</div>
<%-- 用于提交內(nèi)容的按鈕,響應(yīng)點(diǎn)擊事件為 check() --%>
posted on 2011-05-27 22:21
donghang73 閱讀(229)
評(píng)論(0) 編輯 收藏