PDA

View Full Version : Open Links in New window


jdurity1976
10-02-2006, 06:28 PM
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>

_Aerospace_Eng_
10-02-2006, 06:44 PM
Change
location = newlocation
to
window.open(newlocation);