LZ使用的是什么语言,可以参考下fck。不过,可以不造轮子,尽量就不要造轮子了。

解决方案 »

  1.   

    直接用现成的吧
    FCK就不错,还开源
      

  2.   

    是呀,FCKEditor就很不错。
    不过上网一搜索的话,可以找到很多。
    没有什么太难的技术。
    使用JAVASCRIPT就可以了。
    不过要是自己做个完善的编辑器的话工作量会很大。
      

  3.   

    http://www.scriptlover.com/controls/?url=/controls/163editor/
      

  4.   

    因为我这里要实现的是非常简单的功能
    而且自己想diy一个
    再找找吧
      

  5.   

    用5楼的那个编辑器也可以我记得我有个CSDN的这个编辑器
      

  6.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
    <a href="javascript:addBold()">加粗</a>
    <iframe src="" name= "edit" id="edit" frameborder="1" width="500" height="300" style="border:#000000 1px solid;"></iframe> 
    <script language= "javascript">
    var editor = document.getElementById("edit").contentWindow;//这句
       editor.document.designMode="On";//这句
        editor.document.contentEditable = true; //这句
        //兼容Firfox
        editor.document.open();
        editor.document.writeln('<html><body></body></html>');
        editor.document.close();
    //字体特效 - 加粗方法一 
    function addBold(){
        editor.focus();
        editor.document.execCommand("Bold", false, null);//还有这里
    }
    //主要的是这几句句,剩下的document.execCommand方法的具体用法你搜下好了
    </script> 
    </body>
    </html>