问题
I need to wrap an iFrame in a div wihtout the iFrame reloading the content. Is there a way to suppress the refresh or another way to wrap the content?
回答1:
wrap does a wrapAll function, in which jQuery clones the <iframe/>, and this causes the refresh in Firefox.
update: I think it is a bug with the iframe handling code in the browsers, because the following code is not working either:
var
$i = $('iframe[src^="http://www.site.com"]'),
$d = $('<div class="test"/>');
$d.append($i);
来源:https://stackoverflow.com/questions/4397270/jquery-wrap-without-refresh