Rafraichir un div

Fermé
remz13127 Messages postés 235 Date d'inscription jeudi 17 janvier 2008 Statut Membre Dernière intervention 4 avril 2019 - 28 juil. 2011 à 23:18
 remz - 7 août 2011 à 13:31
Bonjour,

J'ai besoin de votre aide !

J'ai un site de webradio et grace a un script javascript je peux afficher l'émission en cours. Mais, ce script ne se raffraichit pas et si l'auditeur ne raffraichit pas la page et bien il a toujours la meme émission en cours alors que ce n'est plus du tout celle qui est en cours à l'antenne...

Je voudrais donc rafraichir ce code toutes les 10 minutes par exemple, mais juste ce code, pas toute la page !

Comment faire ?

Je vous poste ce fameux code ici meme :

<div id="page" style="position:absolute;left:448px;top:121px;z-index:11" align="left">
<script language="JavaScript">
<!-- Hide the script from non-Javascript browsers
var date_statement="";
var time_statement="";
var today=new Date();
var month="";
var day="";
function todays_date() {
var day_of_week=today.getDay();
document.day=""
if(day_of_week==0)
document.day="Dimanche";
if(day_of_week==1)
document.day="Lundi";
if(day_of_week==2)
document.day="Mardi";
if(day_of_week==3)
document.day="Mercredi";
if(day_of_week==4)
document.day="Jeudi";
if(day_of_week==5)
document.day="Vendredi";
if(day_of_week==6)
document.day="Samedi";
}
function time_of_day() {
var time=today.getHours()+0;
var day_of_week=today.getDay();
if(day_of_week==1)
if(time>=0 && time<18)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==1)
if(time>=18 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==1)
if(time>=20 && time<21)
time_statement="http://www.remzouilleradio.com/images/melo.png"
if(day_of_week==1)
if(time>=21 && time<23)
time_statement="https://www.remzouilleradio.com/images/libreantennexzone.png"
if(day_of_week==1)
if(time>=23 && time<24)
time_statement="http://www.remzouilleradio.com/images/vincent.png"


if(day_of_week==2)
if(time>=0 && time<18)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==2)
if(time>=18 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==2)
if(time>=20 && time<22)
time_statement="http://www.remzouilleradio.com/images/melo.png"
if(day_of_week==2)
if(time>=22 && time<24)
time_statement="http://www.remzouilleradio.com/images/vincent.png"


if(day_of_week==3)
if(time>=0 && time<18)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==3)
if(time>=18 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==3)
if(time>=20 && time<21)
time_statement="http://www.remzouilleradio.com/images/melo.png"
if(day_of_week==3)
if(time>=21 && time<23)
time_statement="https://www.remzouilleradio.com/images/libreantennexzone.png"
if(day_of_week==3)
if(time>=23 && time<24)
time_statement="http://www.remzouilleradio.com/images/vincent.png"


if(day_of_week==4)
if(time>=0 && time<18)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==4)
if(time>=18 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==4)
if(time>=20 && time<22)
time_statement="http://www.remzouilleradio.com/images/melo.png"
if(day_of_week==4)
if(time>=22 && time<23)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==4)
if(time>=23 && time<24)
time_statement="http://www.remzouilleradio.com/images/dancefloorinvasion.png"


if(day_of_week==5)
if(time>=0 && time<18)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==5)
if(time>=18 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==5)
if(time>=20 && time<22)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==5)
if(time>=22 && time<24)
time_statement="http://www.remzouilleradio.com/images/florian.png"


if(day_of_week==6)
if(time>=0 && time<16)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==6)
if(time>=16 && time<19)
time_statement="http://www.remzouilleradio.com/images/florian.png"
if(day_of_week==6)
if(time>=19 && time<20)
time_statement="https://www.remzouilleradio.com/images/remi.png"
if(day_of_week==6)
if(time>=20 && time<21)
time_statement="http://www.remzouilleradio.com/images/romain.png"
if(day_of_week==6)
if(time>=21 && time<22)
time_statement="http://www.remzouilleradio.com/images/dj-martin-tianor.png"
if(day_of_week==6)
if(time>=22 && time<23)
time_statement="http://www.remzouilleradio.com/images/dj-guest.png"
if(day_of_week==6)
if(time>=23 && time<24)
time_statement="http://www.remzouilleradio.com/images/dj-thoony-d.png"


if(day_of_week==0)
if(time>=0 && time<20)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
if(day_of_week==0)
if(time>=20 && time<22)
time_statement="http://www.remzouilleradio.com/images/melo.png"
if(day_of_week==0)
if(time>=22 && time<24)
time_statement="http://www.remzouilleradio.com/images/ttsp.png"
}
// -- End Hiding Here -->
</script>

<script language="JavaScript"><!-- Hide the script from non-Javascript browsers
time_of_day();
document.writeln("<img src='"+time_statement+"' />")
todays_date();
document.writeln("<DT> "+date_statement+"<DT>")
// -- End Hiding Here -->
</script>
</div>


Merci d'avance à vous !!

1 réponse

gilbert1995 Messages postés 414 Date d'inscription samedi 12 septembre 2009 Statut Membre Dernière intervention 30 mai 2013 29
29 juil. 2011 à 00:09
setTimeout("time_of_day();", 600000)
2
Merci !!
0