Ive got a cycling banner with links. I would like to get these links to open into a new window, but i cant seem to amke it work. Here is my HTTP page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<frame name="view">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Viewing page</title>
<script src="bannerlinks.js"
language="javascript" type="text/javascript">
</script>
</head>
<body>
<div align="center">
<a href="" target="_blank"><img src="images/anime.gif" alt="ad banner" width="500" height="99" border="0" align="baseline" id="adBanner" /></a>
</div>
</body>
</html>
This is the script im using:
window.onload = initBannerLink;
var adImages = new Array("images/anime.gif","images/ninja.jpg","images/newegg.gif","images/hswlogo.jpg");
var adURL = new Array("var thisAd = 0;
function rotate() {
thisAd++;
if (thisAd == adImages.length) {
thisAd = 0;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout("rotate()", 3 * 1000);
}
function newLocation() {
document.location.href = " + adURL[thisAd];
return false;
}
function initBannerLink() {
if (document.getElementById("adBanner").parentNode.tagName == "A") {
document.getElementById("adBanner").parentNode.onclick = newLocation;
}
rotate();
}
Can anyone tell me what im missing to get this to open in a new window? I would like it to not be a popup because of all the blockers. Is it because im using frames, ive never really done much with frames cuz i hate them so.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<frame name="view">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Viewing page</title>
<script src="bannerlinks.js"
language="javascript" type="text/javascript">
</script>
</head>
<body>
<div align="center">
<a href="" target="_blank"><img src="images/anime.gif" alt="ad banner" width="500" height="99" border="0" align="baseline" id="adBanner" /></a>
</div>
</body>
</html>
This is the script im using:
window.onload = initBannerLink;
var adImages = new Array("images/anime.gif","images/ninja.jpg","images/newegg.gif","images/hswlogo.jpg");
var adURL = new Array("var thisAd = 0;
function rotate() {
thisAd++;
if (thisAd == adImages.length) {
thisAd = 0;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout("rotate()", 3 * 1000);
}
function newLocation() {
document.location.href = " + adURL[thisAd];
return false;
}
function initBannerLink() {
if (document.getElementById("adBanner").parentNode.tagName == "A") {
document.getElementById("adBanner").parentNode.onclick = newLocation;
}
rotate();
}
Can anyone tell me what im missing to get this to open in a new window? I would like it to not be a popup because of all the blockers. Is it because im using frames, ive never really done much with frames cuz i hate them so.