码迷,mamicode.com
首页 > 编程语言 > 详细

CKEditor4 在java web中的应用说明(详细可行)

时间:2014-07-30 23:39:35      阅读:398      评论:0      收藏:0      [点我收藏+]

标签:des   blog   http   java   os   strong   文件   io   

按照官方的说明书就可,这里主要注意一点!!
  就是<script src="../ckeditor.js"></script>中js文件的路径问题,我的ckeditor文件夹是在WebContent文件夹下,jsp文件是同一层目录的,所以最后的代码应该是
  
<script type="text/javascript"src="./ckeditor/ckeditor.js"></script>

注意斜杆号前面的一点,或者干脆写成如下格式:

<script type="text/javascript"src="ckeditor/ckeditor.js"></script>

这个问题弄了半个小时。!!!哎。

 

下次写关于上传图片的和上传文件的。

 
CKEditor 4 Documentation

CKEditor Quick Start Guide

The aim of this article is to get you up and running with CKEditor in two minutes.

Download

Visit the official CKEditor Download site. For a production site we recommend you choose the default Standard Package and click theDownload CKEditor button to get the .zip installation file. If you want to try out more editor features, you can download the Full Packageinstead.

bubuko.com,布布扣

Unpacking

Unpack (extract) the downloaded .zip archive to the ckeditor directory in the root of your website.

Trying Out

CKEditor comes with a collection of samples that you can try out to verify if the installation was successful as well as see some CKEditor usage scenarios, both basic and more advanced.

Open the following page in the browser: http://<your site>/ckeditor/samples/index.html

Browse the samples to see how CKEditor can be used and customized.

Adding CKEditor to Your Page

If the samples work correctly, you are ready to build your own site with CKEditor included.

To start, create a simple HTML page with a <textarea> element in it. You will then need to do two things:

  1. Add a call to the CKEditor script in the <script> element of your page.
  2. Use the CKEDITOR.replace() method to replace the existing <textarea> element with CKEditor.

See the following example:

<!DOCTYPE html>
<html>
    <head>
        <title>A Simple Page with CKEditor</title>
        <!-- Make sure the path to CKEditor is correct. -->
        <script src="../ckeditor.js"></script>
    </head>
    <body>
        <form>
            <textarea name="editor1" id="editor1" rows="10" cols="80">
                This is my textarea to be replaced with CKEditor.
            </textarea>
            <script>
                // Replace the <textarea id="editor1"> with a CKEditor
                // instance, using default configuration.
                CKEDITOR.replace( ‘editor1‘ );
            </script>
        </form>
    </body>
</html>

When you are done, open your sample page in the browser.

Congratulations! You have just installed and used CKEditor on your own page in virtually no time!

bubuko.com,布布扣

Next Steps

Go ahead and play a bit more with the samples; try to add the same functionality to your own pages (you can always see the sample source for some hints). And when you are ready to dive a bit deeper into CKEditor, you can try the following:

  1. Check the Configuration section to see how to adjust the editor to your needs.
  2. Get familiar with Advanced Content Filter. This is a useful tool that adjusts the content inserted into CKEditor to the features that are enabled and filters out disallowed content.
  3. Modify your toolbar to only include the features that you need. You can find the complete list of all toolbar buttons available in your build in the "Toolbar Configurations" sample.
  4. Browse the Add-ons Repository for some additional plugins or skins.
  5. Use CKBuilder to create your custom CKEditor build.
  6. Browse the Developer‘s Guide for some further ideas on what to do with CKEditor and join the community to discuss all things CKEditor with fellow developers!

CKEditor4 在java web中的应用说明(详细可行),布布扣,bubuko.com

CKEditor4 在java web中的应用说明(详细可行)

标签:des   blog   http   java   os   strong   文件   io   

原文地址:http://www.cnblogs.com/angus67/p/3879417.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!