How can JavaScript make new page that contains more JavaScript?

后端 未结 3 823
醉话见心
醉话见心 2020-12-12 01:29

I\'m opening new page using JS and writing into it the HTML code, however when I try to write JS inside the new page using document.write() function it doesn\'

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 01:55

    EDIT: as others pointed out, you should escape the slash with a backslash.

    The easy (but non standard) solution is to break your string:

    opened.document.write("");
    

提交回复
热议问题