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

opening windows 1

Status
Not open for further replies.

gojohnnygogogogo

Programmer
May 22, 2002
161
GB
hello,

If I use javascript to open a new window it works fine, but then if I use the same code to open another window from the window just opened, it opens the new window in the previous window.

(how many times can you say window in one sentance!)

<a href=&quot;#&quot; onclick=&quot;javascript:window.open('./view.asp', 'title', 'toolbars=no, height=500, width=450')&quot;>

How can I modify the above code to open a new window, instead of reusing already opened windows ?

hope you understand that,!
thanks

 
Make sure to give the new window a different name!

<a href=&quot;#&quot; onclick=&quot;javascript:window.open('./view.asp', 'newTitle', 'toolbars=no, height=500, width=450')&quot;>

If you use the same name, JS thinks that you are using the same object again....
 
This is a local forum for local people!

Hi Johnnygogogogo

I can't get that to work either, but if you use a simple javascript popup function and call the function from the link, then it will work.

eg put this in your first page:

<script>

function openpopup(){

var popurl=&quot;woo2.htm&quot;

winpops=window.open(popurl,&quot;&quot;,&quot;width=375,height=308,&quot;)

}

</script>
<a href=&quot;#&quot; onclick=&quot;openpopup()&quot;>hello</a>

then in the second page put exactly the same script, but just change the popurl to the location of your third popup page and that will work.

janinja
 
oops I didn't see mwolfs reply before I posted mine! sorry.
 
excellent thank you for the help.

Changing the title to a newtitle has worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top