有時(shí)我們會(huì)用到一個(gè)頁(yè)面呈現(xiàn)多個(gè)ueditor編輯器,實(shí)現(xiàn)方法如下:
<!-- 加載編輯器的容器 --> <script id="container01" name="content" type="text/plain" style="width: 600px;height: 100px;"></script> <!-- 加載編輯器的容器 --> <script id="container02" name="content" type="text/plain" style="width: 600px;height: 100px; margin-top: 30px;"></script> <!-- 配置文件 --> <script type="text/javascript" src="./ueditor/ueditor.config.js"></script> <!-- 編輯器源碼文件 --> <script type="text/javascript" src="./ueditor/ueditor.all.js"></script> <!-- 實(shí)例化編輯器 --> <script type="text/javascript"> var ue01 = UE.getEditor('container01'); var ue02 = UE.getEditor('container02'); </script>
呈現(xiàn)效果如下: