Nieuw lid |
|
Ik heb een banner met de volgende JavaScript:
<script language="javascript" type="text/javascript">
<!-- Script afkomstig van Sitemasters.be
link = new Array()
bann = new Array()
link[0] = "Banners/banner1.html";
bann[0] = "Banners/banner1.gif";
link[1] = "Banners/banner2.html";
bann[1] = "Banners/banner2.gif";
link[2] = "Banners/banner3.html";
bann[2] = "Banners/banner3.gif";
var i = Math.floor(Math.random() * bann.length);
function showbanner() {
if(i < bann.length-1){
i ++;
}
else{
i = 0
}
var samen = "<a href='" + link[i] + "' target='_blank'>" +
"<img src='" + bann[i] + "' width='468' height='60' border='0'></a>";
if(document.getElementById) {
document.getElementById('banner').innerHTML = samen;
}
else if(document.all) {
document.all[banner].innerHTML=samen;
}
setTimeout('showbanner()',15000);
}
window.onload = showbanner ();
// einde script -->
</script>
<script language="javascript" type="text/javascript"> <!-- Script afkomstig van Sitemasters.be link[0] = "Banners/banner1.html"; bann[0] = "Banners/banner1.gif"; link[1] = "Banners/banner2.html"; bann[1] = "Banners/banner2.gif"; link[2] = "Banners/banner3.html"; bann[2] = "Banners/banner3.gif"; var i = Math .floor(Math .random () * bann .length ); function showbanner() { if(i < bann.length-1){ i ++; } else{ i = 0 } var samen = "<a href='" + link[i ] + "' target='_blank'>" + "<img src='" + bann[i] + "' width='468' height='60' border='0'></a>"; if(document.getElementById) { document.getElementById('banner').innerHTML = samen; } else if(document.all) { document.all[banner].innerHTML=samen; } setTimeout('showbanner()',15000); } window.onload = showbanner (); // einde script --> </script>
En deze code in de body:
<div id="banner">
<script language="javascript" type="text/javascript">
document.write("<a href='" + link[i] + "' target='_blank'>" +
"<img src='" + bann[i] + "' width='160' height='300' border='0'></a>");
</script>
</div>
<div id="banner"> <script language="javascript" type="text/javascript"> document .write ("<a href='" + link[i ] + "' target='_blank'>" + "<img src='" + bann[i] + "' width='160' height='300' border='0'></a>"); </script> </div>
Nu geeft hij in de FireFox JavaScript console de volgende fout:
Fout document.getElementById("banner") has no properties
Ik kan de fout niet vinden, wie kan mij helpen?
Alvast bedankt
|