Replacing Entire Page Including Head Using Javascript

前端 未结 5 1630
时光取名叫无心
时光取名叫无心 2020-12-04 23:14

I have a Javascript function that is passed a string. The string that it is passed is an entire webpage, including the header. I need the Javascript to replace the entire

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 00:10

    document.getElementsByTagName("html")[0].innerHTML Contains both head and body tags. I Usually avoid document.open\write\close

提交回复
热议问题