How do you set size when opening a new window?

Discussion in 'HTML' started by JimO, Apr 16, 2004.

  1. JimO

    JimO Guest

    When opening up a new window, is there a way to set it's size? Here is some
    example code.

    <table border="0" cellspacing="1" width="100%">

    <tr>

    <td width="20%" align="center"><font size="1" face="Comic Sans MS"><a
    target="_blank" href="try_again.htm">Thomas Edison</a></font></td>

    <td width="20%" align="center"><font face="Comic Sans MS" size="1"><a
    target="_blank" href="try_again.htm">Alexande G. Bell</a></font></td>

    <td width="20%" align="center"><font face="Comic Sans MS" size="1"><a
    target="_blank" href="you_correct.htm">Lewis Latimer</a></font></td>

    <td width="20%" align="center"><font face="Comic Sans MS" size="1"><a
    target="_blank" href="try_again.htm">Andrew Carnegie</a></font></td>

    <td width="20%" align="center"><font face="Comic Sans MS" size="1"><a
    target="_blank" href="try_again.htm" height="10%" width="10">John D.
    Rockefeller</a></font></td>

    </tr>

    </table>



    Thanks,

    Jim
    JimO, Apr 16, 2004
    #1
    1. Advertising

  2. "JimO" <> wrote:

    > When opening up a new window, is there a way to set it's size?


    Not in HTML. Otherwise, maybe. But...

    We could tell you, but then we would have to killfile you.

    Hint of the day:

    "Opening up new browser windows is like a vacuum cleaner sales person who
    starts a visit by emptying an ash tray on the customer's carpet. Don't
    pollute my screen with any more windows, thanks (particularly since
    current operating systems have miserable window management). If I want a
    new window, I will open it myself!"

    http://www.useit.com/alertbox/990530.html

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Apr 17, 2004
    #2
    1. Advertising

  3. JimO

    Richard Guest

    Jukka K. Korpela wrote:

    > "JimO" <> wrote:


    >> When opening up a new window, is there a way to set it's size?


    > Not in HTML. Otherwise, maybe. But...


    There are many reasons for wanting to open a new window outside of popup
    spam.
    One good example is having the window for an enlarged view of an image.
    Or perhaps for something in the way that gifworks.com uses their's.
    Richard, Apr 17, 2004
    #3
  4. JimO

    Richard Guest

    JimO wrote:

    > When opening up a new window, is there a way to set it's size? Here is
    > some example code.


    A new window is generally done using javascript, cgi, or even php.
    Search the web for "window.open".
    Enjoy the reading.
    Richard, Apr 17, 2004
    #4
  5. JimO

    Rob McAninch Guest

    Richard <news:>:

    > JimO wrote:
    >
    > > When opening up a new window, is there a way to set it's
    > > size?


    With JavaScript yes, but keep in mind that not everyone will use
    JavaScript. So you may need to plan a plain HTML alternative.

    Something here may help:
    http://tech.irt.org/articles/script5.htm

    > A new window is generally done using javascript, cgi, or even
    > php. Search the web for "window.open".


    New browser windows have nothing to do with Common Gateway
    Interface, or the PHP Hypertext Preprocessor. That window.open is
    JavaScript.


    --
    Rob - http://rock13.com/
    Web Stuff: http://rock13.com/webhelp/
    Rob McAninch, Apr 17, 2004
    #5
  6. JimO

    Steve Pugh Guest

    "Richard" <Anonymous@127.001> wrote:

    >A new window is generally done using javascript, cgi, or even php.


    Please give an example using CGI or PHP. We'd love to see one.

    >Search the web for "window.open".


    And is that JavaScript? CGI? PHP?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Apr 17, 2004
    #6
  7. While the city slept, Jukka K. Korpela <> feverishly
    typed:

    > "JimO" <> wrote:
    >
    >> When opening up a new window, is there a way to set it's size?

    [...]
    > We could tell you, but then we would have to killfile you.


    LOL! ;-)

    Cheers,
    Nige

    --
    Nigel Moss.

    Email address is not valid. . Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    In the land of the blind, the one-eyed man is very, very busy!
    nice.guy.nige, Apr 17, 2004
    #7
  8. JimO

    Galsaba Guest

    Here is the JavaScript code for this function. Let's say that when you click on
    the words "see smal window" you will see the page call "mywindow.htm"

    <a onClick = "MessageBoard()">see small window</a>

    then, you have the function:

    <Script Language = JavaScript>

    function MessageBoard(dest,reg)
    {
    window.open("mywindow,htm","no","height=340,width=580")
    }
    </Script>

    You may learn more if you post your message to the javascript group.

    Aaron
    Galsaba, Apr 17, 2004
    #8
  9. nice.guy.nige, Apr 17, 2004
    #9
  10. JimO

    Ulujain Guest

    Richard wrote:

    > JimO wrote:
    >
    > > When opening up a new window, is there a way to set it's size? Here is
    > > some example code.

    >
    > A new window is generally done using javascript, cgi, or even php.
    > Search the web for "window.open".
    > Enjoy the reading.
    >


    Show me how you'd open a sized popup window using PHP.

    'Later
    Peter



    --
    Peter aka Ulujain - Computing for Fun!
    http://www.ulujain.org/
    Ulujain, Apr 17, 2004
    #10
  11. While the city slept, Galsaba <> feverishly typed:

    > Here is the JavaScript code for this function. Let's say that when
    > you click on the words "see smal window" you will see the page call
    > "mywindow.htm"
    >
    > <a onClick = "MessageBoard()">see small window</a>


    <a href="mywindow.htm" onclick="MessageBoard('mywindow.htm'); return
    false;">see small window</a>

    This will go some way to allowing your visitors to view the intended file
    whether or not they have javascript available / activated.

    Cheers,
    Nige

    --
    Nigel Moss.

    Email address is not valid. . Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    In the land of the blind, the one-eyed man is very, very busy!
    nice.guy.nige, Apr 17, 2004
    #11
  12. nice.guy.nige wrote:
    > While the city slept, Galsaba <> feverishly typed:
    >> <a onClick = "MessageBoard()">see small window</a>

    >
    > <a href="mywindow.htm" onclick="MessageBoard('mywindow.htm'); return
    > false;">see small window</a>
    >
    > This will go some way to allowing your visitors to view the intended
    > file whether or not they have javascript available / activated.


    Agreed [1]. An interesting problem occurs though with 3rd party pop-up
    blockers that re-assign the window.open method (I think one of Norton's
    products does this). The window.open is replaced with an empty object or
    anonymous function that won't open a window. However, users with
    javascript enabled select the hyperlink, follow the onclick and
    reference the window.open object (which now does nothing) and then the
    function exits, but the onclick event is then cancelled by the "return
    false;". So users with javascript enabled, but with popular "Internet
    Security" packages installed, get neither the original href nor the
    pop-up window and I would imagine that only a tiny percentage of those
    users know what has happened and how to work around it. Ultimately the
    best advice must be "don't use window.open in a general WWW
    environment".

    [1] You can usually shorten the event handler to
    onclick="MessageBoard(this.href)". There's also the possible requirement
    for a keyboard event handler (but YMMV).
    --
    Andrew Urquhart
    - FAQ: www.html-faq.com/
    - Archive: www.google.com/groups?q=alt.html
    - Contact: www.andrewu.co.uk/contact/
    - Employ me: Front/middle tier ASP developer with WAI & web standards
    Andrew Urquhart, Apr 17, 2004
    #12
  13. Ulujain wrote:

    > Show me how you'd open a sized popup window using PHP.


    This chunk of HTML:

    <a href="foobar.html"
    onclick="window.open(this.href);return false;">Foobar</a>

    Combined with the following HTTP header:

    Content-Script-Type: application/x-httpd-php4

    ;-)

    Technically, this tells the browser that any inline script is PHP to be
    executed client side. Of course, most browsers will ignore it and execute
    it as Javascript instead.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Apr 17, 2004
    #13
  14. JimO

    DU Guest

    Richard wrote:
    > JimO wrote:
    >
    > > When opening up a new window, is there a way to set it's size? Here is
    > > some example code.

    >
    > A new window is generally done using javascript, cgi, or even php.
    > Search the web for "window.open".
    > Enjoy the reading.
    >
    >


    The number 1 problem with your post is that a wide majority (say, 90%
    and more) of copy-N-paste javascript sites with popup maker, popup
    generator create invalid code which won't work on different browsers,
    create incorrect code and/or with incorrect explanations, create bad
    functions from an accessibility and usability perspective, maintains the
    user dependent and ignorant on the best way to use popups, do not
    educate users on the best way to use popup and how to code window.open()
    properly, do not inform its users on how to make their popup code more
    accessible and avoid problems on the user's side.

    DU
    DU, Apr 17, 2004
    #14
  15. JimO

    Galsaba Guest

    Well, Jim -
    I am curious to know, with the 15 answers that you got here, do you know now
    what the answer is? If you do, please tell me what answer has the information
    that you were looking for.
    Thanks,
    Jo
    Galsaba, Apr 17, 2004
    #15
  16. JimO

    Grahammer Guest

    "JimO" <> wrote in message
    news:y6Zfc.13340$...
    > When opening up a new window, is there a way to set it's size? Here is

    some
    > example code.


    Yes. Design your page so it doesn't matter.
    Grahammer, Apr 18, 2004
    #16
  17. JimO

    havvb

    Joined:
    Nov 20, 2011
    Messages:
    1
    Quick Question:

    Full disclosure, I am new to programming. I am looking for html script, or any script, that will allow me to build a website that automatically maximizes the browser's size when a visitor visits my page.

    Ideal:
    1. Visitor clicks on my page (with window size settings diminished)
    2. Page loads, screen maximizes to the maximum size - proportionate to the monitor. Does not create a new page, expands within tab.


    Much appreciated,
    havvb, Nov 20, 2011
    #17
    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. Patrick Olurotimi Ige

    Closing child window when opening a new Window

    Patrick Olurotimi Ige, Dec 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    423
    Patrick Olurotimi Ige
    Dec 14, 2004
  2. UJ
    Replies:
    2
    Views:
    7,478
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  3. Jerry Manner
    Replies:
    2
    Views:
    6,498
    SpaceGirl
    May 30, 2005
  4. Clara
    Replies:
    6
    Views:
    569
    Clara
    Apr 25, 2005
  5. Allan
    Replies:
    1
    Views:
    100
    Randy Webb
    Aug 6, 2004
Loading...

Share This Page