source: spip-zone/_plugins_/horloge/horloge.js.html @ 70524

Last change on this file since 70524 was 26902, checked in by paolo2@…, 11 years ago

Seulement faire un hit serveur si un modele horloge est effectivement sur la page

File size: 619 bytes
Line 
1#HTTP_HEADER{'Content-Type: text/javascript'}
2jQuery().ready(function(){
3if ( $("span.horloge-h24").length || $("span.horloge-h12").length || $("span.horloge-enlong").length )
4        {       showTime();     
5}
6});
7
8function showTime() {
9$.get("#URL_SITE_SPIP/plugins/horloge/horloge.php", function(curTime) {
10var refresh = [(60 - $("sec", curTime).text()) * 1000 ];
11$(".horloge-h24").html([ $("h24", curTime).text() ].join(''));
12$(".horloge-h12").html([ $("h12", curTime).text() ].join(''));
13$(".horloge-enlong").html([ $("enlong", curTime).text() ].join(''));
14var refreshfunc = 'showTime()';
15setTimeout(refreshfunc, refresh);
16});
17}
Note: See TracBrowser for help on using the repository browser.