open new window

G

groovetherapy

Hi,

I am creating my web page so that if you click on a picture, it opens
up a new window. Pretty easy stuff - but the problem is that it doesn't
open up a new window with every pic. Instead it just replaces the
image.

How can I ensure a new window is opened up everytime.

here is my code (am I missing something?)..

<a href="#" target="_top"
onClick="MyWindow=window.open('http://www.groovetherapy.com.au/ima...lbars=no,resizable=no,width=600,height=565');
return false;"><img
src="http://www.groovetherapy.com.au/images/small_scans/calbido_sml.jpg"></a>


...and you can check out the page here:

http://www.groovetherapy.com.au/archive.htm
 
B

BootNic

Hi,

I am creating my web page so that if you click on a picture, it
opens up a new window. Pretty easy stuff - but the problem is that
it doesn't open up a new window with every pic. Instead it just
replaces the image.

How can I ensure a new window is opened up everytime.

here is my code (am I missing something?)..
[snip]

..and you can check out the page here:
[snip]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
var MyWindow;
function pop(x){
MyWindow=window.open(x.href,x.target,'width=600,height=565')
}
</script>
<title></title>
</head>
<body>
<a href=
"http://www.groovetherapy.com.au/images/label_scans/calbido.jpg"
target="_blank" onclick="pop(this);return false;"><img src=
"http://www.groovetherapy.com.au/images/small_scans/calbido_sml.jpg">
</a>
</body>
</html>
 
E

Ed Mullen

Hi,

I am creating my web page so that if you click on a picture, it opens
up a new window. Pretty easy stuff - but the problem is that it doesn't
open up a new window with every pic. Instead it just replaces the
image.

How can I ensure a new window is opened up everytime.

here is my code (am I missing something?)..

<a href="#" target="_top"
onClick="MyWindow=window.open('http://www.groovetherapy.com.au/ima...lbars=no,resizable=no,width=600,height=565');
return false;"><img
src="http://www.groovetherapy.com.au/images/small_scans/calbido_sml.jpg"></a>


..and you can check out the page here:

http://www.groovetherapy.com.au/archive.htm

FYI, my browser is set to NEVER open a new window. It will always open
a new tab instead. Trying to force visitors to do what you want is
probably not a polite thing, and many people will be either confused by
it or very ticked off.
 
J

Jose

How can I ensure a new window is opened up everytime.

Are you =really= sure that the user wants this behavior without
recourse? Each new window uses resources. Some users don't have much.

Let the user choose.

Jose
 
G

groovetherapy

Thanks for all the quick responses. Some very valid points brought up
that I had not considered (I'm pretty new to all of this).

my above link was incorrect - here is the correct one..

http://www.groovetherapy.com.au/archive.html

as you will see - I have some smaller images (record covers) and I
wanted the user to be able to click on each image, and a new window
with an enlarged image appears.

...you will have to forgive the state of my webpage at the moment. It is
still in progress and not online for general viewing yet.

cheers
 
G

groovetherapy

Ok - I tried the java script that was posted above - it works, but
still doesn't open up individual windows. It seems to do exactly the
same as the original html code I posted above. What exactly does this
Java script do that is any different? Are there any advantages to using
script instead?


<script type="text/javascript">
var MyWindow;
function pop(x){
MyWindow=window.open(x.href,x.target,'width=600,height=565')


}


</script>
<title></title>
</head>
<body>
<a href=
"http://www.groovetherapy.com.au/images/label_scans/calbido.jpg"
target="_blank" onclick="pop(this);return false;"><img src=
"http://www.groovetherapy.com.au/images/small_scans/calbido_sml.jpg">
</a>
 
B

BootNic

Ok - I tried the java script that was posted above - it works, but
still doesn't open up individual windows. It seems to do exactly the
same as the original html code I posted above. What exactly does
this Java script do that is any different? Are there any advantages
to using script instead?
[snip]

The link will work and do something useful IF javascript is disabled.

All of it depends on user settings. It is questionable on what the results
will be.

In FireFox 0.8.0+ it opens a new window that is 600 X 595 each time
its clicked.

In Mozilla 1.7.12 it opens a new window that is 600 X 595 each time
its clicked.

In IE 6 it opens a new window that is the same size of the opener
window each time its clicked.

In Opera 8.52 it opens a new tab each time its clicked.

Each one is doing what I have it set to do.

Each one I can also click on the link and choose how I want it opened.

I have no way of knowing what filters/popup blockers you may have,
what your settings are, what browser you are using.

I do not see any advantages to using javascript in this example, if
anything I think its a disadvantage.

I think the best choice would be to use

<a href=
"http://www.groovetherapy.com.au/images/label_scans/calbido.jpg"
img src=
"http://www.groovetherapy.com.au/images/small_scans/calbido_sml.jpg">
</a>

without the javascript and without the target.
 
?

=?ISO-8859-1?Q?G=E9rard_Talbot?=

Thanks for all the quick responses. Some very valid points brought up
that I had not considered (I'm pretty new to all of this).

my above link was incorrect - here is the correct one..

http://www.groovetherapy.com.au/archive.html

What you do is difficult to understand and to justify.

toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=565

You want, say, 4 images to be loaded in new, individual, distinct,
separate created windows and not be reusing, recycling in an already
opened secondary window. The user can choose to do that if the code of
your link does not interfere with his browser settings. Also, note that
90% or so of people on the web have a scr. res. smaller than 1200 x 600:
so, right there, the user can not have more than 2 windows side by side.

Finally, your window features are trying to remove basic fundamental
accessibility window features (scrollbars=no,resizable=no) and, at the
same time, remove window features which browser manufacturers are now
ensuring/forcing their rendering (location=no,status=no): so what you do
goes against the users' best interests and, indirectly, against your
best interests.
Your window sizing requests will be fooled more often then honored.

DOM:window.open()
Usability issues
http://developer.mozilla.org/en/docs/DOM:window.open#Usability_issues

Gérard
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top