Web Analytics Made Easy -
StatCounter Open Links in New window - CodingForum

Announcement

Collapse
No announcement yet.

Open Links in New window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Open Links in New window

    Need a little bit of help with this simple script, I would like to open the links in a new window but when i Use target=_blank anywhere I keep getting errors. Can anyone help?

    <script language="javascript">
    <!--
    function loadpage() {
    index1 = 0;
    listofimages = new Array(4);
    listofimages[0] = new Image(324,85)
    listofimages[0].src = "http://www.GMOSSBANNER.jpg"
    listofimages[1] = new Image(324,85)
    listofimages[1].src = "http://www.are_you_going_to_heaven.jpg"
    listofimages[2] = new Image(324,85)
    listofimages[2].src = "http://www.absolute_comp_banner.jpg"
    listofimages[3] = new Image(324,85)
    listofimages[3].src = "http://www.attacking_banner.jpg"

    thetimer = setTimeout("changeimage()", 5000);

    }

    function changeimage(){
    index1 = index1 + 1
    if (index1 == "4") {
    index1 = 0
    }
    imagesource = listofimages[index1].src
    window.document.banner1.src = imagesource

    thetimer = setTimeout("changeimage()", 5000);

    }

    function changepage() {
    if (index1 == 0) {
    newlocation = "link0.htm"
    }
    else if (index1 == 1) {
    newlocation = "link1.htm"
    }
    else if (index1 == 2) {
    newlocation = "link2"
    }
    else if (index1 == 3) {
    newlocation = "link3.htm"
    }
    location = newlocation
    }

    // -->
    </script>

  • #2
    Change
    Code:
    location = newlocation
    to
    Code:
    window.open(newlocation);
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment

    Working...
    X