Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i get document.location.href to target new browser window? 1

Status
Not open for further replies.

bluetang

Technical User
Apr 10, 2001
14
DE
I'm currently using:

<body onLoad=&quot;javascript:window.print();document.location.href='nextpage.cfm'&quot;>

to print a page and then redirect the user to the next page without them having to do anything.

i'd like to open the next page in a new browser window, but i'm really new to javascript and i can't figure out how.

any ideas would be most appreciated :)
thanks
 
use window.open() instead with a window name of &quot;_blank&quot;

-pete
 
thanks, but could you show me how i'd use that within the code i inserted? i really meant it when i said i have no idea <g>
 
bluetang, here ya go:

<body onLoad=&quot;javascript:window.print();window.open('nameOFfile.html')&quot;>

No need to add the name=&quot;_blank&quot;, because the window.open syntax opens in a new window...
Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
it worked - BRILLIANT!!!

thank you! thank you! thank you!!! :-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top