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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Window Problems

Status
Not open for further replies.

bigbird3156

Programmer
Feb 20, 2001
183
AU
Hi, I have set up a href link to open up a stripped back window with disclaimer info in it. It works, however when it opens up the original page (with the actual link) changes and displays the text

[Object]

here is the href:
<a href="javascript:window.open('disclaimer.htm','newwindowzoom','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=410,height=400,left=100,top=100')">click
here</a>

Any ideas about what is going wrong??

[wiggle]The Bird from Down Under- Bigbird 3156
Programmer?? - I thought the option was pretender not programmer!![jester]
 
To make this the cleanest, don't put the window.open statement in a href. You can put it on an onclick handler on the anchor tag, example:

Code:
<a href="#" onclick="window.open('disclaimer.htm','newwindowzoom','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=410,height=400,left=100,top=100')">click 
  here</a>

<.
 
your a legend

thanks for that

[wiggle]The Bird from Down Under- Bigbird 3156
Programmer?? - I thought the option was pretender not programmer!![jester]
 
To add to monksnake's statement, make sure you return false at the end of the onclick handler - otherwise your screen will jump to the top of the page and the url will show with a # at the end:

Code:
<a href="#" onclick="window.open(....)[!];return false[/!]">click here</a>

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top