Open new browser - multiple links per page - how?

G

Geoff Fox

I am in the final moments of designing a new website. One of the pages
(http://www.auditionfactory.com/samples.php) has four links to show
sample work. I would like these links to open new browser windows when
clicked. I have found scripts that will allow one to open, and a few
that claim to all multiples to be opened, but so far nothing that will
allow a user to open multiple new windows as they click to see new
samples.

Does anyone know of a way to accomplish this.

Thanks,
Geoff Fox
Connecticut
USA
 
M

mertas

Geoff said:
I am in the final moments of designing a new website. One of the pages
(http://www.auditionfactory.com/samples.php) has four links to show
sample work. I would like these links to open new browser windows when
clicked. I have found scripts that will allow one to open, and a few
that claim to all multiples to be opened, but so far nothing that will
allow a user to open multiple new windows as they click to see new
samples.

Does anyone know of a way to accomplish this.

Thanks,
Geoff Fox
Connecticut
USA


<a href="http://www.tonyterzi.com" target=_blank>Tony Terzi</a>
try this...
 
J

Jungleman

target=_blank>

I think this just opens the page in the existing browser window. In any
case "target" has been deprecated so the code might not validate. Hence
the need to use Javascript, right?
 
G

Geoff Fox

Yes, that's my understanding. It's got to be in Javascript.

The many Javascript solutions I've found only work for one new browser
window being spawned. So, if you click on one link, you can't click on
the others until that first link's 'new' browser is closed.

I'm still searching for a solution. Any help gratefully appreciated.

All the best,
Geoff Fox
 
E

Evertjan.

Geoff Fox wrote on 06 jul 2006 in comp.lang.javascript:
Yes, that's my understanding. It's got to be in Javascript.

Please quote what you are replying to. If you want to post a followup via
groups.google.com, don't use the "Reply" link at the bottom of the article.
Click on "show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
The many Javascript solutions I've found only work for one new browser
window being spawned. So, if you click on one link, you can't click on
the others until that first link's 'new' browser is closed.

<div
onclick=
'window.open("a.html","_blank","");'+
'window.open("b.html","_blank","");'+
'window.open("c.html","_blank","");'+
'window.open("d.html","_blank","");'+
'window.open("e.html","_blank","");'>
Open 5 new windows by one click here
</div>

not tested
 
R

Randy Webb

Evertjan. said the following on 7/6/2006 4:07 PM:
Geoff Fox wrote on 06 jul 2006 in comp.lang.javascript:


<div
onclick=
'window.open("a.html","_blank","");'+
'window.open("b.html","_blank","");'+
'window.open("c.html","_blank","");'+
'window.open("d.html","_blank","");'+
'window.open("e.html","_blank","");'>
Open 5 new windows by one click here
</div>

not tested

The + doesn't work in that code the way you think it would in anything
but IE.

Tested:

<div id="test" onclick='
window.open("a.html","_blank","");
window.open("b.html","_blank","");
window.open("c.html","_blank","");
window.open("d.html","_blank","");
window.open("e.html","_blank","");
'>
Open 5 new windows by one click here
</div>

IE: 5 new windows
FF: 5 new windows
Opera 9: 1 new window with 4 popups blocked.
 
G

Geoff Fox

Thanks all. I appreciate the help, but this wasn't exactly what I
wanted to do. I apologize if I've described my problem incorrectly.

I want to be able to open new windows, one at a time, as my visitors
click individual links. In the Javascript I've tried, once the first
new window is open, no other new windows can be spawned. You have to
close the first spawned window, which is now hidden under the active
window you're trying to click on.


In all the solutions I've tried,
 
L

Lasse Reichstein Nielsen

Jungleman said:
target=_blank>

I think this just opens the page in the existing browser window.

That depends on the browser. In a tabbed browser, it most likely
opens a new tab. In, e.g., IE, it opens a new window.
Whether that counts as a "new browser", I'll leave for the philosophers
(I guess the best test of whether it's a new browser or a new window
in the same browser is to crash one and see if it takes the other one
down with it :).
In any case "target" has been deprecated so the code might not
validate.

It's not deprecated. It's a standard feature of HTML 4.01
Transitional, and any document using the appropriate DOCTYPE
should have no problem validating.
Hence the need to use Javascript, right?

I would question the need for a new window first. After that,
I'll question a design that requires Javascript.

/L
 
D

Dougeez

On 6 Jul 2006 10:43:24 -0700, Geoff Fox wrote...
I am in the final moments of designing a new website. One of the pages
(http://www.auditionfactory.com/samples.php) has four links to show
sample work. I would like these links to open new browser windows when
clicked. I have found scripts that will allow one to open, and a few
that claim to all multiples to be opened, but so far nothing that will
allow a user to open multiple new windows as they click to see new
samples.

Does anyone know of a way to accomplish this.

Thanks,
Geoff Fox
Connecticut
USA


If you use this, I believe it uses a new window for all the link on the page,
without having to define the "target" for each...


<head>
<base target="_blank">
</head>

Hope it's helpful.

Dougeez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top