[英]Insert HTML into iFrame at caret (IE)
How would I insert HTML into an iFrame in IE? 如何将HTML插入IE中的iFrame? In chrome and firefox I used execCommand insertHtml, but it's not supported in IE. 在chrome和firefox中,我使用了execCommand insertHtml,但IE中不支持它。
I figured out how to paste html into a content editable div using pasteHTML, but I cant figure out how to insert into an iFrame. 我想出了如何使用pasteHTML将html粘贴到内容可编辑的div中,但无法弄清楚如何插入到iFrame中。
The frame is within a page acting as a text-area, so design mode is on. 该框架位于充当文本区域的页面内,因此启用了设计模式。
iframe id="editor" name="editor" class="theframe" onkeydown="enter(this,event)" onpaste="return handlepaste(this, event)"></iframe>
这将起作用:
$("iframe").contents().find("body").html('my_new_content');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.