zoukankan      html  css  js  c++  java
  • 富文本编辑器

    <!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>
    <script language="javascript">
    function doBold(){
    doc.execCommand('Bold');
    Editor.focus();
    }
    function doItalic(){
    doc.execCommand('Italic');
    Editor.focus();
    }
    function doUnderline(){
    doc.execCommand('Underline');
    Editor.focus();
    }
    function doStrikeThrough(){
    doc.execCommand('StrikeThrough');
    Editor.focus();
    }
    function doCut(){
    doc.execCommand('Cut');
    Editor.focus();
    }
    function doCopy(){
    doc.execCommand('Copy');
    Editor.focus();
    }
    function doPaste(){
    doc.execCommand('Paste');
    Editor.focus();
    }
    function doUndo(){
    doc.execCommand('Undo');
    Editor.focus();
    }
    function doPrint(){
    doc.execCommand('Print');
    Editor.focus();
    }

    function doSubscript(){
    doc.execCommand('Subscript');
    Editor.focus();
    }
    function doSuperscript(){
    doc.execCommand('Superscript');
    Editor.focus();
    }

    function SeePreview(){
    doc.body.innerHTML=form1.Preview.value;
    return false;
    }

    function EditResource(){
    form1.Preview.value=doc.body.innerHTML;
    return false;
    }
    </script>
    </head>
    <body>
    富文本编辑器<p>
    <a href="javascript:doUndo();">复原</a>&nbsp;<a href="javascript:doPrint();">打印</a>       
    &nbsp;<a href="javascript:doCut();">剪切</a>&nbsp;<a href="javascript:doCopy();">复制</a>&nbsp;                         
    <a href="javascript:doPaste();">粘贴</a>&nbsp;                                                                   
                                                
    <br>                  
    <a href="javascript:doBold();">粗</a>&nbsp; <a href="javascript:doItalic();">斜</a>&nbsp;<a href="javascript:doUnderline();"><u>下划</u> </a>&nbsp;                  
    <a href="javascript:doSuperscript();"><u>上标</u> </a>&nbsp;<a href="javascript:doSubscript();"><u>下标</u> </a>&nbsp;                               
    <a href="javascript:doStrikeThrough();"> <strike>中划</strike></a>&nbsp;                                                                         
    居左 居中 居右 缩进 缩出 图片 插入连接                                                               
    <br>                              
                      
    <form id=form1 method="POST" action="edit-m.htm?val='javascript:docv;'">                                                                        
    <IFRAME id=Editor style="WIDTH: 100%; HEIGHT: 150px;                                                                
    src="about:blank"></IFRAME>                                                   
    <BUTTON id=mxh onclick=EditResource();Preview.focus();>编辑源代码</BUTTON>              
    <BUTTON class="function" onclick=SeePreview();Preview.focus();>结果预览</BUTTON>                      
    <br>        
    <TEXTAREA id=Preview style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 150px; </TEXTAREA>                                                               
        
    <input type="submit" value="提交" name="B1">&nbsp;              
                                                                   
    <input type="reset" value="全部重写" name="B2">                                                                       
    </form>        
                
    <br>              
                                                                       
    <script language="javascript">                                                           
    var doc;                                                          
    doc=document.frames.Editor.document;                                                  
    doc.designMode = "On";                                                           
    window.setTimeout('Editor.focus()',100);                                                            
    </script>                                                           
    </body>                                                                        
    </html>

  • 相关阅读:
    ListView具有多种item布局——实现微信对话列
    CSDN 2013年度博客之星评选——分享几张厦门杭州的美图
    不做旁观者,给博主最有力的支持——博客之星评选,期待您的支持,谢谢路过的朋友投上您宝贵的一票
    Android应用中使用及实现系统“分享”接口
    android手势创建及识别
    JSON数据源的多值参数实现
    葡萄城报表本地设计器
    如何设计带查询条件的报表
    巧用SQL语句补足不完全数据报表
    表格数据分组报表
  • 原文地址:https://www.cnblogs.com/ruixinyu/p/5639397.html
Copyright © 2011-2022 走看看