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

Open several links in the SAME new window?

Status
Not open for further replies.

slakker

MIS
Jun 5, 2003
59
0
0
US
Hi All.. I know that I can just specify the same named target to a bunch of the links I have on a page, and they will ALL open up in that same new window, BUT.. that window stays minimized and it looks to the user that nothing new opened if you went back to original page and clicked another link..

Is there a way to have that NEW window open up and come to the front of the user everytime another link is clicked off the original page?

This is what I mean..

<a href="page1.asp" target="ConsGeneral">page1</a><br>
<a href="page2.asp" target="ConsGeneral">page2</a><br>
<a href="page3.asp" target="ConsGeneral">page3</a><br>
<a href="page4.asp" target="ConsGeneral">page4</a><br>
<a href="page5.asp" target="ConsGeneral">page5</a><br>

Thanks in advance! :)
 
Try this:
Code:
<a href="page1.asp" target="ConsGeneral" onclick="window.mywin.open('page1.asp','ConsGeneral');mywin.focus();return false">page1</a><br>

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Thanks Adam, I tried that code, but it didn't work.. it says. Error on page down in status window.. here's how I layed out the href's:

<a href="page.asp#part1" target="ConsGeneral" onclick="window.mywin.open('page.asp#part1','ConsGeneral');mywin.focus();return false">part1</a><br>

<a href="page.asp#part2" target="ConsGeneral" onclick="window.mywin.open('page.asp#part2','ConsGeneral');mywin.focus();return false">part2</a><br>

Also, it would be great if I could put most of code in the header, and then assign the function to links that I want to behave this way..

Thanks again
 

Another option would be to place:

Code:
<body onload="window.focus();">

In each of your target pages.

Hope this helps,
Dan
 
Sorry, but i'm still not sure how to use this

I tried putting this into my original page, and also the linked-to pages..

Tried using the body code with adams's code, and without

still doens't work
 
Oops, I messed up. This should work better:
Code:
<script>
var mywin;
function openWin(url){
  mywin=window.open(url,'ConsGeneral');
  mywin.focus();
  return false;
}
</script>
Code:
<a href="page1.asp" target="ConsGeneral" onclick="return openWin('page1.asp')">page1</a><br>
Or you could use Dan's suggestion.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top