contentDocument是获得iframe子窗口的document对象,但兼容ff和ie8+

contentWindow是获得子窗口的window对象,兼容大部分浏览器,contentWindow.document才是获得document对象

所以获得iframe内容时一般兼容性写法是这样的  (iframe.contentDocument||iframe.contentWindow.document).body.innerHTML

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-04
  • 2021-09-10
  • 2022-12-23
相关资源
相似解决方案