如何使用jquery访问iFrame父页面? [英] how to access iFrame parent page using jquery?
本文介绍了如何使用jquery访问iFrame父页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个iframe,为了访问父元素我实现了以下代码:
I have an iframe and in order to access parent element I implemented following code:
window.parent.document.getElementById('parentPrice').innerHTML
如何使用jquery获得相同的结果?
UPDATE :或者如何使用jquery访问iFrame父页?
How to get the same result using jquery?
UPDATE: Or how to access iFrame parent page using jquery?
推荐答案
要在iFrame的父级使用:
To find in the parent of the iFrame use:
$('#parentPrice', window.parent.document).html();
$()包装器的第二个参数是要搜索的上下文。这默认为文档。
The second parameter for the $() wrapper is the context in which to search. This defaults to document.
这篇关于如何使用jquery访问iFrame父页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文