Forse ho quasi risolto...mi servirebbe un aiutino finale perché sono poco pratica di Javascript:
riesco a caricare 2 banner ma al terzo mi da errore di runtime...qualcuno mi sa dire qual é l'errore nel mio JavaScript?
Ecco il codice:
codice:
<script type="text/javascript" language="JavaScript">
<!--
banner=new Array;
banner[0] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="644" height="80" id="bannerElecom" align=""><param name=movie value="bannerElecom.swf"><param name=quality value=high><embed src="bannerElecom.swf" quality=high width="644" height="80" name="bannerElecom" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
banner[1] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="644" height="80" id="bannerSport" align=""><param name=movie value="bannerSport.swf"><param name=quality value=high><embed src="bannerSport.swf" quality=high width="644" height="80" name="bannerSport" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
banner[2] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="644" height="80" id="bannerDiMascio" align=""><param name=movie value="bannerDiMascio.swf"><param name=quality value=high><embed src="bannerDiMascio.swf" quality=high width="644" height="80" name="bannerDiMascio" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
caricato = false;
function caricaBanner() {
if(!caricato) {
numimage = Math.round(Math.random()*(banner.length-1));
document.write(banner[numimage]);
caricato = true;
}
else {
if(numimage == (banner.length-1)) {
numimage = 0;
}
else {
numimage++;
}
document.write(banner[numimage]);
}
setTimeout("caricaBanner()",3000);
}
caricaBanner();
//-->
</script>
Grazie!