Home > Backend Development > PHP Tutorial > php calls CKEditor editor_PHP tutorial

php calls CKEditor editor_PHP tutorial

WBOY
Release: 2016-07-13 17:45:16
Original
972 people have browsed it

************************
Title:php calls CKEditor editor
Author:insun
Blog:http://yxmhero1989.blog.163.com

******************/
In the past, it was still fckeditor in the hacker world. Various CMSs liked to call it, and hackers also liked to find many holes in it.
Recently I am building a php backend in my company and I need to call the editor
First quote its js between :
Then call:



This is the simplest method, directly from the class.
You can also use <script type="text/javascript">CKEDITOR.replace("content");< /script
>
But I find it troublesome~~~

php调用CKEditor编辑器 - InSun - Minghacker is Insun


================================================== =========================================

The 3.x version is very convenient to use, and you don’t have to worry about forming two contents with the same name. In fact, it is okay to omit the id of the textarea, because CKEditor will first search by name. If it cannot be found, it will then search by id. And the editor will replace the original textarea at the position of textarea.

Set editor skin, width and height

代码
<textarea  cols="90" rows="10" id="content" name="content">cfteatextarea>
<script type="text/javascript" src="ckeditor/ckeditor.js">script>
<script type="text/javascript">

script>

The skin value should be a folder name under the ckeditor/skins folder. If it points to a non-existent skin, the editor will not be displayed.

Set value (can also be used to clear value)

CKEDITOR.instances.content.setData("Pacer"); // content is the first parameter value of CKEDITOR.replace (that is, the ID value of textarea)

or

var editor = CKEDITOR.replace("content");
editor.setData("Pacer");

Get value

alert(CKEDITOR.instances.content.getData()); // content is the first parameter value of CKEDITOR.replace

or

var editor = CKEDITOR.replace("content");
alert(editor.getData());

Insert picture

To demonstrate this example, it is best to put it in the event handler of the button, aiming for some delay.

CKEDITOR.instances.content.insertHtml("");

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478696.htmlTechArticle********************** Title:php calls CKEditor Editor Author:insun Blog:http://yxmhero1989.blog.163.com ****************/ In the past, in the hacker world, it was still fckeditor, with various CMs. ..
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template