How do I have a function that opens a new tab in the browser with custom html that is generated in the root tab?
Asked
Active
Viewed 2,629 times
-2
-
How about https://developer.mozilla.org/en-US/docs/Web/API/Window/open – Bakudan Nov 17 '16 at 18:38
-
http://stackoverflow.com/a/4907854/3569921 – marcusshep Nov 17 '16 at 18:39
1 Answers
2
You can do this
var x=window.open();
x.document.open().write('<h1>Test</h1>');
x.close();
Note that you cannot force it to be a new tab as that is a user preference (of new window / new tab)

Turv
- 101
- 3