dà un errore perchè manca l'elemento con id="citta". Io ho scritto così (non so se è quello che volevi)
codice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>xhtml 1.0</title> <script type="text/javascript"> // <![CDATA[ function WebCam() { var vettore = new Array ( new Array("Moncalieri (TO)", "http://www.nimbus.it/moncalieri/monc_vista.jpg"), new Array("Isola d' Elba", "http://www.elbalink.it/webcam/webcamview.php?n=4"), new Array("Vista di Genova", "http://www.stefanome.it/current.jpg"), new Array("Grado (UD)", "http://80.105.84.114/webcam2.php"), new Array("Bologna", "http://www.bolognameteo.it/broadcast.jpg"), new Array("Brescia", "http://www.starrylink.it/webcam/brescia/brescia1M.jpg"), new Array("Canazei (TN)", "http://www.dolomitiwebcam.com/vernel/mega.jpg"), new Array("Cattolica (RN)", "http://www.riminibeach.it/assets/images/cattolica/cattolica1.jpg"), new Array("Cuneo", "http://www.provincia.cuneo.it/_images/webcam/netcam2.jpg.tmp"), new Array("Etna", "http://www.etnaweb.net/EtnaCam/WebCam2/ultima.jpg"), new Array("Folgaria (TN)", "http://82.105.110.187/axis-cgi/jpg/image.cgi?compression=25"), new Array("Napoli", "http://www.salernometeo.it/Webcam/napoli/currentsmall.jpg"), new Array("Pontebba (UD)", "http://www.comunitamontanadelgemonese.it/UD11/pontebba.jpg")); var rnd = Math.floor(Math.random() * vettore.length); //Numero random intero compreso tra 0 e il limite superiore dell'array if (document.getElementById('citta')) document.getElementById('citta').innerHTML = vettore[rnd][0]; document.getElementById('immagine').src = vettore[rnd][1]; } </script> <script type="text/javascript"> <!-- //set image paths src = ["http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16066.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16105.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16140.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16230.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16240.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16289.gif", "http://banners.wunderground.com/weathersticker/big2_metric_cond/language/www/global/stations/16405.gif"] //set corresponding urls url = ["http://www.wunderground.com/global/stations/16066.html", "http://www.wunderground.com/global/stations/16105.html", "http://www.wunderground.com/global/stations/16140.html", "http://www.wunderground.com/global/stations/16230.html", "http://www.wunderground.com/global/stations/16240.html", "http://www.wunderground.com/global/stations/16289.html", "http://www.wunderground.com/global/stations/16405.html"] //set duration for each image duration = 2; //Please do not edit below ads=[]; ct=0; function switchAd() { var n=(ct+1)%src.length; if (ads[n] && (ads[n].complete || ads[n].complete==null)) { document["Ad_Image"].src = ads[ct=n].src; } ads[n=(ct+1)%src.length] = new Image; ads[n].src = src[n]; setTimeout("switchAd()",duration*1000); } function doLink(){ location.href = url[ct]; } onload = function(){ if (document.images) switchAd(); } //--> </script> <body onload="WebCam();"> <img id="immagine" /></body> </html>
Ciao


Rispondi quotando