FckEditor帮助文档解读
1.在页面里调用FckEditor
第一步:
在页面的<head></head>标签中去包含fckeditor.js文件,如下:
<head runat="server"> <title></title> <script src="../../fckeditor.js" type="text/javascript"></script> </head>
第二步:
现在可以在页面里通过js调用生成FckEditor编辑器了,这里有三种方法:
方法一:
在页面要编辑器的位置直接调用js语句,生成编辑器:
<script type="text/javascript"> var oFCKeditor = new FCKeditor('FCKeditor1'); oFCKeditor.BasePath = "/fckeditor/"; oFCKeditor.Create(); </script>
方法二:
替换页面中的<texteare>元素,并在页面onload时间添加如下代码:
<script type="text/javascript"> window.onload = function() { var oFCKeditor = new FCKeditor('MyTextarea'); oFCKeditor.BasePath = "/fckeditor/"; oFCKeditor.ReplaceTextarea(); } </script>在<body>里面添加了一个<texteare>元素:
<textarea id="MyTextarea" name="MyTextarea">This is <b>the</b> initial value.</textarea>
方法三:
使用Ajax方法