开发者

How to copy element from an iframe into main DOM in IE7 using jquery

开发者 https://www.devze.com 2023-02-22 15:34 出处:网络
I\'m trying to move an html element from within an iframe with some event handlers attached (attached using jquery) to the main DOM of the page.

I'm trying to move an html element from within an iframe with some event handlers attached (attached using jquery) to the main DOM of the page.

e.g.

var elem = $('iframe').contents().find('span');
elem.detach();
$(document.body).append(elem);
..

It seems to be fine in Chrome and FF, but in IE7 I get an "Inval开发者_运维问答id Argument" error being thrown.

If anyone knows some trick to do this that would be great.

Ta


If the two elements are in different domains you will get cross domain errors.

read this article it might help solve your problems

0

精彩评论

暂无评论...
验证码 换一张
取 消