Difference between contentDocument and contentWindow javascript iframe/frame access properties

旧城冷巷雨未停 提交于 2019-11-28 07:15:00

I think the <iframe> MDN documentation explains it well:

From the DOM iframe element, scripts can get access to the window object of the included HTML page via the contentWindow property. The contentDocument property refers to the document element inside the iframe (this is equivalent to contentWindow.document), but is not supported by Internet Explorer versions before IE8.

So you would use contentWindow the same way you use window and contentDocument as you use document.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!