in reply to Change location in new window
It must be done before the request is started. It's too late by the time your script executes. By using the target attribute on the <form> or <a> tag, the script specified by the action or href attribute will load in a new window.
<form target="_blank" action="..." ...> ... </form>
or
<a target="_blank" href="..." ...>...</a>
|
|---|