JavaScript Open/Display current page in new tab or window

html, internet-explorer, javascript

Solution

Yes, just pass current address to window.open():

window.open(window.location.href, '_blank');

Code example

Problem

Is it possible to open a page in a new window or tab from within the page? Yes, I mean current HTML page itself. Not by the call from another one like this: ``` window.open('page.html','_blank'); ``` Could be JS and `<body onLoad=...>` manipulations. Need this for modifying quite complex CGI, where only few actions supposed to open in a new window. Cannot modify the code, so only pure HTML+JS solution needed. Thank you.

Original source