Results 1 to 18 of 18

Thread: tag for new, smaller window

  1. #1

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220

    tag for new, smaller window

    What's the HTML tag for opening a new, smaller window? ...and how do i specifiy the new size or whatever? Thanks
    - you've been privileged to read a post by Miz

  2. #2
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    window.open("something.html", "name", "toolbar,status,height=HEIGHT,width=WIDTH");

    etc etc etc

    -morrowasted

  3. #3

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220

    Question

    Originally posted by morrowasted
    window.open("something.html", "name", "toolbar,status,height=HEIGHT,width=WIDTH");

    etc etc etc
    so it's javascript?
    - you've been privileged to read a post by Miz

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Yes it's JavaScript.
    Have I helped you? Please Rate my posts.

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If you don't want to use javascript for some reason, you can use a hyperlink and make its target property "_blank".

    But then you have no control over size or position, etc.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    alright, sorry fellas...i'm new to js
    - you've been privileged to read a post by Miz

  7. #7
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    If you need help implementing it, just ask.
    Have I helped you? Please Rate my posts.

  8. #8

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    Originally posted by Acidic
    If you need help implementing it, just ask.
    how dare you read my mind!? ...anywho, how do i implement it into an html doc or what do i have to do...you get the idea. thanks a lot.
    - you've been privileged to read a post by Miz

  9. #9
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    erm...

    <a onclick="window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');" href="#">

    or

    <script>
    function MakeWindow(){
    window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');
    }
    <script>
    and
    <a onclick="MakeWindow()" href="#">

    -morrowasted

  10. #10

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    Originally posted by morrowasted
    erm...

    <a onclick="window.open('something.html', 'name', 'toolbar,status,height=HEIGHT,width=WIDTH');" href="#">
    you are the man. exactly what i needed. thanks!

    one thing though...here's the exact line i use:

    Code:
    <a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500');" href="contacts.html">Contact Us</a>
    but it opens the link in the same window as well as opening it in the new one
    Last edited by dolor; Dec 29th, 2003 at 10:55 PM.
    - you've been privileged to read a post by Miz

  11. #11
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    you dont need the href in there, you are telling it to open the popup aswell as the page as a normal hyperlink. Change to:

    Code:
    <a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500');">Contact Us</a>

  12. #12

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    k, much thanks
    - you've been privileged to read a post by Miz

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Better yet, change it to
    <a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500'); return false" href="contacts.html">Contact Us</a>

    This way, there's a popup in JavaScript-enabled browsers and a normal link in others, so you avoid locking people out.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    Originally posted by CornedBee
    Better yet, change it to
    <a onclick="window.open('contacts.html', 'Contacts', 'toolbar,status,height=500,width=500'); return false" href="contacts.html">Contact Us</a>

    This way, there's a popup in JavaScript-enabled browsers and a normal link in others, so you avoid locking people out.
    sweet. thanks. i have seen that return statement before, but wasn't sure about what it does.
    - you've been privileged to read a post by Miz

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It prevents the browser from doing any default action following the event. In the case of a link this means following the link.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    Originally posted by CornedBee
    It prevents the browser from doing any default action following the event. In the case of a link this means following the link.
    you know, i like this JS stuff. it's pretty simple and makes the interface more user-friendly and all that, but it has a few bugs when moving from browser to browser. i have heard that this is why many people have moved to perl. what do you think about this?
    - you've been privileged to read a post by Miz

  17. #17
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Nothing. Perl in CGI scripts is a server-side language, JavaScript is client-side. Their purposes are different, as are the things you can do with them. You can't do an image rollover with Perl, and you can't retrieve data from a database with JavaScript.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  18. #18

    Thread Starter
    Addicted Member dolor's Avatar
    Join Date
    Sep 2002
    Location
    in a place seldom found on a map
    Posts
    220
    Originally posted by CornedBee
    Nothing. Perl in CGI scripts is a server-side language, JavaScript is client-side. Their purposes are different, as are the things you can do with them. You can't do an image rollover with Perl, and you can't retrieve data from a database with JavaScript.
    ah, makes sense. good show.
    - you've been privileged to read a post by Miz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width