在IE7中

var conentDiv = document.createElement("div");

 document .body .appendChild(conentDiv);

 document .appendChild(conentDiv);

都不会报错,但是在IE11中

 document .appendChild(conentDiv);会报错:javascript runtime error:HierarchyRequestError

 

由于 div是document .body的子元素,而不是 document的子元素。

相关文章:

  • 2021-11-28
  • 2021-10-25
  • 2022-12-23
  • 2021-11-15
  • 2021-05-26
  • 2021-09-08
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2022-02-11
  • 2021-05-16
  • 2021-07-09
  • 2021-09-18
相关资源
相似解决方案