Replacing Entire Page Including Head Using Javascript

前端 未结 5 1624
时光取名叫无心
时光取名叫无心 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:04

    Script

    javascript:document.open('text/html');document.write('HAI

    OMG HAI2U!!!1

    ');document.close();

    DOM snapshot of the resulting page

    HAI

    OMG HAI2U!!!1

提交回复
热议问题