Can I open a new window and populate it with a string variable?

后端 未结 5 1910
别跟我提以往
别跟我提以往 2021-02-12 03:53

I am having a bit of a battle with something that seems simple. I have a [javascript] string that has DOM elements in it and would like to open a new window (window.open()?) and

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 04:24

    If you need in new tab you can use this.

    const win = window.open('about:blank', '_blank');
    win.document.write('

    test

    '); win.focus();

提交回复
热议问题