SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open in a new window

    Hi all,
    I'm looking for a script which will ensure that all the links in my website will be openned in new window ?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    UK
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use a script, but what if they have JavaScript turned off? Your pages wont function how you want them too.

    Instead, wny not use <a href="" target="_blank">link text</a>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't use this script since links are brought using JS.
    what was the script you were talking about ?

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    must be a better way but this should get you going

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd"
    >

    <
    html>

    <
    head>
      <
    title></title>
    <
    script language="JavaScript" type="text/javascript">
    <!--
    var 
    LinkAry=new Array('http://www.js-examples.com','http://www.sitepoint.com','http://www.vicsjavascripts.org.uk');

    function 
    openExample(name,l) {
     
    WinName=name;
     
    window.open(LinkAry[l],WinName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=700,height=650,left=10,top=10')
    }

    //-->
    </script>

    </head>

    <body>


    <img src="http://www.vicsjavascripts.org.uk/StdImages/Zero.gif" width="125" height="96"  border="1" onclick="javascript:openExample('tom',0);" >
    <br>
    <img src="http://www.vicsjavascripts.org.uk/StdImages/One.gif" width="125" height="96"  border="1" onclick="javascript:openExample('dick',1);" >
    <br>
    <img src="http://www.vicsjavascripts.org.uk/StdImages/Two.gif" width="125" height="96"  border="1" onclick="javascript:openExample('harry',2);" >


    </body>

    </html> 


Bookmarks

Posting Permissions

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