使用jQuery在DOM中移动iFrame [英] Move iFrame in the DOM using jQuery
问题描述
我的总体目标是创建一个可以使用jQuery UI(通过创建使用集成调用的自定义工具栏)和TinyMCE进行外观编辑的编辑器.
My overall aim is to create an editor which I can skin using jQuery UI (by creating a custom toolbar which uses integration calls), using TinyMCE.
可以说我在页面上有一个TinyMCE编辑器.实际的编辑器是包含在许多可怕的表代码中的iFrame,这也是当前(待废弃)工具栏所在的位置.我只想要div内的iframe-理想地摆脱表代码.
Lets say I have a TinyMCE editor on a page. The actual editor is an iFrame contained inside a lot of horrible table code, which is also where the current (to be scrapped) toolbar is. I want just the iframe inside a div - ideally get rid of the table code.
所以...我想转型:
<table>
<tr>
<td><iframe id="xyz"></iframe></td>
</tr>
</table>
进入
<div id="test">
<iframe id="xyz"></iframe>
</div>
到目前为止,我已经尝试使用:
So far, I've tried using:
$('#xyz').clone(true).appendTo('#test');
哪个会克隆iframe,但其中没有内容.
Which clones the iframe, but no content inside it.
有没有办法使这项工作成功?
Is there a way to make this work?
如果没有,我可以以某种方式从iFrame周围删除表代码吗?
If not, can I somehow strip the table code from around the iFrame away?
如果我不能这样做,我认为我必须保留表代码.
If I cant do that, I'll think I'll have to keep the table code.
推荐答案
无法正常工作,因此使用一些CSS摆脱了TinyMCE UI.
Couldn't get this working properly, so instead got rid of the TinyMCE UI with a bit of CSS.
感谢所有建议!
这篇关于使用jQuery在DOM中移动iFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!