Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    open all link in blank page

    hi,
    can anyone provide me with a jscript or maybe css tag to have all links on a page opened in a blank window?

    thanks in advance

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Hello:

    If you want them to open in a new window and a new instance of a window for each link that is clicked after the first. Change the window name each time you call the function. Keep all the names the same and it will replace the contents after the first pop-up.

    Code:
    <html>
    <head>
    <script type="text/javascript">
    
    function newWin(url,window_name)
    {
           var my_win=window.open(url,window_name)
           my_win.focus();
           return false;
    }
    </script>
    </head>
    <body>
    <a href="#" onclick="newWin('http://www.codingforums.com','win1');">Coding Forums</a>
    <a href="#" onclick="newWin('http://www.codingforums.com','win2');">Coding Forums</a>
    <a href="#" onclick="newWin('http://www.codingforums.com','win1');">Coding Forums</a>
    </body>
    </html>

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no, that's no good..
    I need something that apply at all links without specifying nothing in them..

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not advisable but you could try:
    <BASE TARGET="_blank">

    .....Willy

  • #5
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    this goes in the header by the way...
    Shawn

  • #6
    New Coder
    Join Date
    Jan 2003
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey guys thanks very much for help, the solution

    <BASE TARGET="_blank">

    is what i was searching for.

    isn't possible to assign that as a css style?

  • #7
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by scsi
    isn't possible to assign that as a css style?
    er .... no.

    styles are for presentation formatting, not presentation mark-up. the former deals with the actual look, not the code that builds the interface.
    Last edited by jbot; 04-27-2004 at 03:02 PM.


  •  

    Posting Permissions

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