1
假設你有下面的HTML中的元素獲取父iframe元素:由位於一個iframe
<div>
<iframe src="..">
<!-- The following would be the content of the iframe -->
<html><head></head><body>
<span>I'm the node</span>
</body></html>
</iframe>
</div>
而且你必須包含iframe中的<span>
元素的變量iframeNode
。您的腳本上下文是父窗口。
你將如何得到父iframe元素:
<iframe src="..."></iframe>
這個節點?
在理論上:
var iframe = iframeNode.myParentIframeElementInTheParentScope;