Fckeditor是一种很是流行的所见即所得的网页编辑器。它可和PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java、以及ABAP等不一样的编程语言相结合。本文讲述fckeditor在ASP,PHP和JS的调用方法:
PHP调用方法:
- <?php
- include('../fckeditor/fckeditor.php') ;
- $oFCKeditor = new FCKeditor('content') ;
- $oFCKeditor->BasePath="../fckeditor/";
- $oFCKeditor->ToolbarSet="Yiyunnet";
- $oFCKeditor->Height='350px';
- $oFCKeditor->Width='630px';
- $oFCKeditor->Value="";
- $myeditor=$oFCKeditor->CreateHtml();
- ?>
ASP调用方法:
-
- <%
- Dim oFCKeditor
- Set oFCKeditor = New FCKeditor
- oFCKeditor.BasePath = "../FCKeditor/"
- oFCKeditor.ToolbarSet = "Yiyunnet"
- oFCKeditor.Width = "100%"
- oFCKeditor.Height = "300"
- oFCKeditor.Value = ""
- oFCKeditor.Create "Content" 'Content是表单项的名称,这里直接显示编辑器
- %>
FCKeditor js调用方法①
- <script src="fckeditor/fckeditor.js"></script>
- <script type="text/javascript">
- var oFCKeditor = new FCKeditor( 'Content' ) ;
- oFCKeditor.BasePath = 'fckeditor/' ;
- oFCKeditor.ToolbarSet = 'Basic' ;
- oFCKeditor.Width = '100%' ;
- oFCKeditor.Height = '400' ;
- oFCKeditor.Value = '' ;
- oFCKeditor.Create() ;
- </script>
FCKeditor js调用方法②
- <script src="fckeditor/fckeditor.js"></script>
- <script type="text/javascript">
- function showFCK(){
- var oFCKeditor = new FCKeditor('Content') ;
- oFCKeditor.BasePath = 'fckeditor/' ;
- oFCKeditor.ToolbarSet = 'Basic' ;
- oFCKeditor.Width = '100%' ;
- oFCKeditor.Height = '200' ;
- oFCKeditor.Value = '' ;
- oFCKeditor.ReplaceTextarea() ;
- document.getElementById("btnShow").disabled = 'true';
- document.getElementById("btnShow").style.display = 'none';
- }
- </script>
- <textarea name="Content"></textarea>
- <input id=btnShow style="display:inline" type=button onclick="showFCK()">