Fckeditor editor call method

Source: Internet
Author: User

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 ()">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.