开发者

JQuery window.parent close effect from iFrame

开发者 https://www.devze.com 2023-02-12 01:31 出处:网络
The following code loaded in an iFrame should alter the contents of a div on the parent page. It doesn\'t.

The following code loaded in an iFrame should alter the contents of a div on the parent page. It doesn't.

var closer = $('#cont开发者_Python百科complete').html();
window.parent.jQuery('#contprintframe').html(closer);

Any ideas?

EDIT :: This is also not working

var closer = $('#contcomplete').html();
$('#contprintframe', window.parent).html(closer);


You will have to 'find' the element you want to change in your parent first, then pass the value.

var closer = $('#contcomplete').html();
$('#contprintframe', window.parent.document).contents().find('#div_you_want_to_change').html(closer);

Hope it works.

0

精彩评论

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