在jsp中有一个textarea,现在我想把他换成 这个fckeditor,如何加脚本呢?

解决方案 »

  1.   

    fck使用时要在web.xml中配置,具体你搜一下
    <fck:editor id="content" basePath="<%=path%>"
    height="300px"
         skinPath="/mingoe/editor/skins/default/"
         toolbarSet="Default"
         imageBrowserURL="/mingoe/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
    linkBrowserURL="/mingoe/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
    flashBrowserURL="/mingoe/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
         imageUploadURL="/mingoe/editor/filemanager/upload/simpleuploader?Type=Image"
    linkUploadURL="/mingoe/editor/filemanager/upload/simpleuploader?Type=File"
    flashUploadURL="/mingoe/editor/filemanager/upload/simpleuploader?Type=Flash">
    ${news.content }
    </fck:editor>
      

  2.   

    网上搜,具体办法我没记下来,一楼的可以实现,不过它不是将textArea转换成FCK,而是直接用。
    如果嫌工具按钮太多了,可以设置toolbarSet成你所选择的样式
      

  3.   

    // 文件开头处加入  
    <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>  
    //要使用的地方加入  
    <FCK:editor id="content" basePath="/FCKeditor/"  
                                    imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"  
                                    linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"  
                                    flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"  
                                    imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"  
                                    linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"  
                                    flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">  
                this is default content :)  
    </FCK:editor>
      

  4.   

    <%@ page language="java" pageEncoding="gbk"%><html>
    <head>
    <title>FCKeditor demo</title>
    <meta http-equiv="content-type" content="text/html; charset=gbk">
    <script type="text/javascript" src="/webtest/fckeditor/fckeditor.js">
    </script>
    </head>
    <body>
    <h1>FCK</h1>
    <form action="/webtest/servlet/addContent" method="post">
    title:<input type="text" name="title" size="80"><br>
    content:
    <script type="text/javascript">
        var oFCKeditor = new FCKeditor( 'editor1' ) ;
        oFCKeditor.BasePath = '/webtest/fckeditor/' ;
        oFCKeditor.Height = 200 ;
    oFCKeditor.toolbarset = 'Basic';
    //oFCKeditor.ToolbarSet = 'Default';
        oFCKeditor.Create() ;
    </script>
    <input name="submit" type="submit" value="submit">
    </form>
    </body>
    </html>
    我用的是JS版的,就在页面上直接调就行了,简单吧!