posts - 32,  comments - 3,  trackbacks - 0
//首先在HEAD区加入要引用的JS
<head>
<script type="text/javascript" src="FCKEditor/fckeditor.js"></script> 
<script type="text/javascript" language="javascript">
function check()
{
   // 取得FCKEditor的值,GetInstance(arg),这里的参数arg是FCKeditor实例名;
   //如声明FCKeditor用var oFCKeditor = new FCKeditor('FCKEditor1',500,200,'Board'),则此时arg就是FCKEditor1;
        var checkContent1 =FCKeditorAPI.GetInstance("FCKEditor1").GetXHTML();
        if (checkContent1 == "")
        {
           strErr += '评论内容不能为空!\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'); //实例名为FCKEditor1
    oFCKeditor.BasePath = sBasePath ;
    oFCKeditor.Create() ;
</script>
</div>
<%-- 用于提交内容的按钮,响应点击事件为 check() --%>
<input id="Button1" value="button" type="button" onclick="check()" />
转自:http://hi.baidu.com/myaspdotnet/blog/item/0b73cd3f0ab9f3c77c1e714a.html
posted on 2011-05-27 22:21 donghang73 阅读(219) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: