• 运行,复制,保存,runCode,copyCode,saveCode,运行代码框


    <script>
    //对代码进行操作
    function runCode(obj)
    {
    var winname = window.open("", "_blank","resizable=yes,scrollbars=yes,status=yes");
    winname.document.open("text/html", "replace");
    winname.document.writeln(obj.value);
    winname.document.close();
    }
    function saveCode(obj,filename)
    {
    var winname = window.open("", "", "top=10000,left=10000");
    winname.document.open("text/html", "replace");
    winname.document.writeln(obj.value);
    winname.document.execCommand("saveas", "", filename + ".htm");
    winname.close();
    }
    function copyCode(obj)
    {
    var rng = document.body.createTextRange();
    rng.moveToElementText(obj);
    rng.scrollIntoView();
    rng.select();
    rng.execCommand("Copy");
    rng.collapse(false);
    }
    </script>


    <textarea name=yongfa365 id=yongfa365></textarea>
    <input type=button onclick=runCode(document.getElementById("yongfa365")) value="运行代码">
    <input type=button onclick=copyCode(document.getElementById("yongfa365")) value="复制代码">
    <input type=button onclick=saveCode(document.getElementById("yongfa365"),"运行,复制,保存,run,copy,save,代码") value="保存代码">

  • 相关阅读:
    实现自动进行金额汇总
    实现模糊查询
    手电筒查询
    lov的建立
    日历 的建立
    快速创建Folder
    TAB页制作
    堆叠画布
    弹性域的开发
    注销记录的实现
  • 原文地址:https://www.cnblogs.com/rhinemetal/p/2568391.html
Copyright © 2020-2023  润新知