日期:2014-05-16 浏览次数:20313 次
<!-- #include file="FCKeditor/FCKeditor.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用JS改变FCKeditor编辑器的值</title>
<script language="JavaScript">
<!--
function getpicdisc()
{
//这里如何写JS来改变编辑器输入框中的内容呢?例如在原来的值“1234”后面加入“这是新增加的内容”?
}
//-->
</script>
</head>
<body>
<form name="theForm" action="test2.asp" method="post" >
标题:<input type="input" name="addname" value="" /><br />
来源:<input type="input" name="articlefrom" value="" /><br />
<input type="button" value="插入图片" onclick="getpicdisc()"/><br>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "400"
oFCKeditor.Value = "1234"
oFCKeditor.Create "articlecontent"
%>
<input type="submit" value="Submit" />
</form>
</body>
</html>
FCKeditorAPI.GetInstance(‘articlecontent′).SetHTML(FCKeditorAPI.GetInstance('articlecontent').GetXHTML(true) + "这是新增加的内容");