同一页面多个百度编辑器
原理:百度编辑绑定id,我们只要使其id不一样就可以了,通过class遍历动态修改id,在拿到id初始化编辑器。
<script class="editor" name="content" type="text/plain"></script>
<script class="editor" name="content" type="text/plain"></script>
<script class="editor" name="content" type="text/plain"></script>
//百度编辑器初始化
<script type="text/javascript"> $('.editor').each(function(index){ $(this).attr('id','container'+index); ue = UE.getEditor('container'+index,{initialFrameWidth:'100%',initialFrameHeight:200,}); }); </script>