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

后端 未结 5 1920
别跟我提以往
别跟我提以往 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条回答
  •  北恋
    北恋 (楼主)
    2021-02-12 04:25

    Yes it's possible...

    var wnd = window.open("about:blank", "", "_blank");
    wnd.document.write(html);
    

    That should do the trick.

提交回复
热议问题