<%@ import namespace="System"%>
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Diagnostics"%>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
<form id="form1" runat="server">
<fckeditorv2:fckeditor id="FCKeditor" runat="server" Width="580px" EnableXHTML="true" EnableSourceXHTML="true" basepath="~/FCKeditor/" height="500px"></fckeditorv2:fckeditor>
</form>
<INPUT TYPE="button" οnclick="InserImg()" value="插图片"> 已经输入了<span id="ShowTextLength">0</span>个字符了
<BR>
当前字符:<INPUT TYPE="text" id="ddd" size=100>
<script language="Javascript">
<!--
function InserImg()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor');
oEditor.InsertHtml("<img src=http://www.baidu.com/img/logo.gif>");
oEditor.EditorDocument.body.onkeyup();
}
function FCKeditor_OnComplete( editorInstance )
{
// editorInstance.Events.AttachEvent( 'OnStatusChange', DoSomething ) ;
var oEditor = FCKeditorAPI.GetInstance('FCKeditor');
oEditor.EditorDocument.body.οnkeyup=function ()
{
$("ShowTextLength").innerHTML =oEditor.EditorDocument.body.innerHTML.length;
$("ddd").value =oEditor.EditorDocument.body.innerHTML;
}
}
function $(id){return document.getElementById(id)}
//-->
</script>
a
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/sejie10011/archive/2008/09/26/2984883.aspx