CKEditor Tutorials (2) - Get Started

Prepare the environment:

You need a website or be able to start a web service on one of your computers.

Download the latest version from the CKEditor website.

Extract the downloaded archive to a directory called ckeditor in the root of your website.

Install firefox and firebug if you haven't.

Fundamental knowledge about html, css, javascript and html5 are also needed to better grasp content below. Visitw3schools or w3school to learn more.



Sample 1: Hello World !

There are two common ways to use CKEditor. One is use it in a frame as example below.

<html>
<head>
    <title>CKEditor Sample1</title>
    <script src="/ckeditor/ckeditor.js"></script>
</head>
<body>
    <form method="post">
        <p>
            My Editor:<br>
            <textarea name="editor1"><p>Hello World!.</p></textarea>
            <script>
                CKEDITOR.replace( 'editor1' );
            </script>
        </p>
        <p>
            <input type="submit">
        </p>
    </form>
</body>
</html>


Or inline editing by leverage contenteditable attribute of HTML5. When clicking inside the <div> contents, the CKEditor toolbar will appear.


<html>
    <head>
        <title>CKEditor Sample2</title>
        <script src="/ckeditor/ckeditor.js"></script>
    </head>
    <body>
        <div id="editable" contenteditable="true">
            <h1>Hello World!</h1>
            <p>The div element that holds this text is now editable.
        </div>
    </body>
</html>


Sample 2: Add a button





Reference:

CKEditor Installation

CKEditor plugin development from Docin.






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值