开发者

JQuery window.parent close effect from iFrame

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜