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

2 pages from single link

Status
Not open for further replies.
Mar 11, 2004
127
GB
Hi everyone,

A friend has asked me if its possible to open 2 pages with different URLs from a single link.

Is this something that can be done?

Thanks,
Anthony
 
Not in the same window. Yes, it's possible, but you have to force another window open, and most popup blockers will prevent that if the original page isn't in a trusted site.

Lee
 
Yeah we're looking at opening 2 new browser windows from the single link.

Any ideas on the script needed to accomplish this?

Thanks,
Anthony
 
Why would you want to do that? The user won't pay attention to three windows at the same time ...

Cheers,
Dian
 
I dont know. I've been asked if its possible, and if so, how to do it.

What they actually want it for I have no idea.

I'm just trying to get the code for them.
 
You could alter the link to call a function and then have that function create the two popup windows however you like.


At my age I still learn something new every day, but I forget two others.
 
But you run the significant risk of a popup blocker allowing NO windows to open, and a lesser risk of Javascript being disabled so nothing is processed.

Lee
 
This isn't recommended but here is a sample of what you want
Code:
<script type="text/javascript">
   function openTwoLinks() {
      window.open("url link1");
      window.open("url link2");
   }

</script>
</head>
<body>
<a href="javascript:void(0)" onclick="openTwoLinks(); return false;">Click here to Open 2 different links</a>

</body>

Of course you fill in the URLs in the window.open statement.
With further parameters on the window.open statement, you can specify the size of the "popup" windows and such
 
Thanks verymuch monksnake!! Much appreciated. I shall pass this info on for them to play with.

Thanks,
Anthony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top