<html> <head> <script type="text/javascript"> function charger_piscines(id_piscines, id_activite) { var script = document.createElement('script'); script.src = "http://www.nageurs.com/xmlhoraires.cgi?id_piscines=" + id_piscines + "&id_activite=" + id_activite + "&json=1"; document.body.appendChild(script); } function json_callback(json) { var piscine = json["grille"]["piscine"][0]; var nom = piscine["nom"]; var url = piscine["url"]; var jours = piscine["calendrier"]["jour"]; document.getElementById('nom_piscine').innerHTML = nom; document.getElementById('nom_piscine').href = url; for(i = 0 ; i < 7 ; i ++) { document.getElementById('j'+i).innerHTML = jours[i]['date']; document.getElementById('h'+i).innerHTML = jours[i]['horaires']; } } </script> </head> <body> <script type="text/javascript"> charger_piscines("bertrand_dauvin", 1); </script> <a href="#" id="nom_piscine">chargement...</a> <table id="horaires"> <tr> <td id="j0" class="pair"></td> <td id="j1" class="impair"></td> <td id="j2" class="pair"></td> <td id="j3" class="impair"></td> <td id="j4" class="pair"></td> <td id="j5" class="impair"></td> <td id="j6" class="pair"></td> </tr> <tr> <td id="h0" class="pair"></td> <td id="h1" class="impair"></td> <td id="h2" class="pair"></td> <td id="h3" class="impair"></td> <td id="h4" class="pair"></td> <td id="h5" class="impair"></td> <td id="h6" class="pair"></td> </tr> </table> </body> </html>