open new window

Discussion in 'HTML' started by groovetherapy@2ser.com, Feb 19, 2006.

  1. Guest

    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/images/label_scans/calbido.jpg','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=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
     
    , Feb 19, 2006
    #1
    1. Advertising

  2. BootNic Guest

    > "" <> wrote:
    > news:....
    >
    > 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>

    --
    BootNic Saturday, February 18, 2006 9:39 PM

    Wife who put husband in doghouse soon find him in cat house.
    *Ancient Chinese Proverbs*
     
    BootNic, Feb 19, 2006
    #2
    1. Advertising

  3. Ed Mullen Guest

    wrote:
    > 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/images/label_scans/calbido.jpg','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=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.

    --
    Ed Mullen
    http://edmullen.net
    http://mozilla.edmullen.net
    http://abington.edmullen.net
     
    Ed Mullen, Feb 19, 2006
    #3
  4. dorayme Guest

    dorayme, Feb 19, 2006
    #4
  5. Jose Guest

    > 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
    --
    Money: what you need when you run out of brains.
    for Email, make the obvious change in the address.
     
    Jose, Feb 19, 2006
    #5
  6. Guest

    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
     
    , Feb 19, 2006
    #6
  7. Guest

    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>
     
    , Feb 19, 2006
    #7
  8. BootNic Guest

    > "" <> wrote:
    > news:....
    >
    > 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.

    --
    BootNic Sunday, February 19, 2006 12:57 PM

    Facts do not cease to exist because they are ignored.
    *Aldous Huxley *
     
    BootNic, Feb 19, 2006
    #8
  9. wrote :
    > 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
    --
    remove blah to email me
     
    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Feb 20, 2006
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cheryl
    Replies:
    2
    Views:
    18,106
    Cheryl
    Nov 12, 2003
  2. Gordon
    Replies:
    3
    Views:
    331
    Steven Burn
    Apr 16, 2004
  3. PC HUA
    Replies:
    2
    Views:
    448
    PC HUA
    May 19, 2004
  4. Berlin  Brown

    Selection; open popup or open a new window

    Berlin Brown, Jun 26, 2006, in forum: Javascript
    Replies:
    0
    Views:
    130
    Berlin Brown
    Jun 26, 2006
  5. Replies:
    1
    Views:
    261
Loading...

Share This Page