The following describes how to call the fckeditor editor in common language development, including asp, php, asp.net, and webpage special effects.
PHP page:
/* Editor */
Include_once "../include/fckeditor. php"; // introduce the editor
$ Editor = new FCKeditor ('content'); // name of the form item
$ Editor-> BasePath = "/fckeditor/"; // Directory of the editor
$ Editor-> ToolbarSet = "Normal"; // name of the toolbar. You can load other
$ Editor-> Width = "95%"; // Width
$ Editor-> Height = "250"; // Height
$ Editor-> Value = $ content; // initial Value
$ Fckeditor = $ editor-> CreateHtml (); // You can output the value of the variable $ fckeditor where you want to display the editor.
$ Tpl-> assign ('fckeditor', $ fckeditor); // template assignment
HTML template page (I use smarty)
{% $ Fckeditor %}
Php page call
Content is the variable name I defined.
$ Content = $ _ POST ["content"];
Add:
<INPUT name = "content" id = "content" type = hidden>
<IFRAME id = "content" src = "fckeditor/editor/fckeditor.html? InstanceName = content & Toolbar = Normal "frameBorder = 0 width = 100% scrolling = no height = 300> </IFRAME>
Modify page:
<INPUT name = "content" id = "content" type = hidden value = "<? Php echo $ rows ['content'];?> ">
<IFRAME id = "content" src = "/fckeditor/editor/fckeditor.html? InstanceName = content & Toolbar = Normal "frameBorder = 0 width = 100% scrolling = no height = 300>
</IFRAME>
FCKeditor asp call method 1
<! -- # INCLUDE file = "FCKeditor/FCKeditor. asp" -->
<Form action = "sampleposteddata. asp" method = "post" target = "_ blank">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
OFCKeditor. BasePath = "/FCKeditor /"
OFCKeditor. ToolbarSet = "Default"
OFCKeditor. Width = "100%"
OFCKeditor. Height = "400"
OFCKeditor. Values = "1234123123"
OFCKeditor. Create "Content"
%>
<Input type = "submit" value = "Submit"/>
</Form>
FCKeditor asp call method 2
<! -- # Include file = "FCKEditor/fckeditor. asp" -->
<%
'Use one editor for multiple controls
Set oFCKeditor = New FCKeditor
OFCKeditor. BasePath = "/fckeditor /"
OFCKeditor. ToolbarSet = "yongfa365"
OFCKeditor. Width = "100%"
OFCKeditor. Height = "100"
OFCKeditor. Config ("ToolbarLocation") = "Out: xToolbar"
OFCKeditor. Value = ""
OFCKeditor. Create "txtContentHeader"
%>
<Div id = "xToolbar"> </div>
<%
Set oFCKeditor = New FCKeditor
OFCKeditor. BasePath = "/fckeditor /"
OFCKeditor. ToolbarSet = "yongfa365"
OFCKeditor. Width = "100%"
OFCKeditor. Height = "400"
OFCKeditor. Config ("ToolbarLocation") = "Out: xToolbar"
OFCKeditor. Value = ""
OFCKeditor. Create "txtContent"
%>
Bytes -------------------------------------------------------------------------------------------------------------
FCKeditor js call method 1
<Script src = "FCKeditor/FCKeditor. js"> </script>
<Script type = "text/javascript">
Var oFCKeditor = new FCKeditor ('content ');
OFCKeditor. BasePath = 'fckeditor /';
OFCKeditor. ToolbarSet = 'basic ';
OFCKeditor. Width = '000000 ';
OFCKeditor. Height = '20140901 ';
OFCKeditor. Value = '';
OFCKeditor. Create ();
</Script>
FCKeditor js call method 2
<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 = '000000 ';
OFCKeditor. Height = '20140901 ';
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 ()">