1. 父窗体获取iframe的window对象
var mainFrame = document.getElementById("myFrame"); var subDocument = mainFrame.contentDocument || mainFrame.contentWindow.document;
2. iframe中获取父窗体window对象
方法:(浏览器兼容)window.parent
方法:(浏览器兼容)
window.parent
Powered by: 博客园 Copyright © 2024 X龙 Powered by .NET 9.0 on Kubernetes