• UEditor js动态创建和textarea中渲染【原】


    UEditor动态创建和textarea中渲染

    http://ueditor.baidu.com/website/examples/textareaDemo.html

    <!DOCTYPE>
    <html>
    <head>
        <title>UEditor js动态创建和textarea中渲染</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
        <script type="text/javascript"    src="D:/OldPC/D/html/jQuery/jquery-3.1.0.js" ></script>
        <script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
        <script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script>
        <style type="text/css">
            #myEditor{
                width: 500px;
                height: 300px;
            }
        </style>
    </head>
    <body>
    <div>
        <h1>UEditor编辑器 js动态创建和DIV区渲染</h1>
        <script id="editor" type="text/plain" style="1024px;height:500px;"></script>
    </div>
    <div id="mydiv">
        UEditor编辑器 js动态创建
    </div>
    <textarea id="myEditor">这里是原始的textarea中的内容,可以从数据中读取</textarea>
    <div>
        <button onclick="createEditor()">js态创建编辑器</button>
        <button onclick="renderEditor()">直接在textarea中渲染编辑器</button>
    </div>
    
    <script type="text/javascript">
         function createEditor() {
            var myscript = $("<script id='editor' type='text/plain' style='1024px;height:500px;'></script>");
            $("#mydiv").append(myscript);
            UE.getEditor('editor');
        }
    
        function renderEditor() {
            UE.getEditor('myEditor', {serverUrl: '/server/ueditor/controller.php'})
        }
    
    </script>
    </body>
    </html>
  • 相关阅读:
    hdoj 2063 过山车
    hdoj 2112 HDU Today
    hdoj 1874 畅通工程续
    hdoj 2544 最短路
    sound of the genuine
    复习webpack的常用loader
    node-sass安装报错
    react-debug
    react-router 4v 路由嵌套问题
    React 中使用sass
  • 原文地址:https://www.cnblogs.com/whatlonelytear/p/7404259.html
Copyright © 2020-2023  润新知