var datalink = '/fr/include/mapinfo.php'; $(document).ready(function() { $("#echeances0").click(function(e) { ajxrec(0);}); $("#echeances1").click(function(e) { ajxrec(1);}); $("#echeances2").click(function(e) { ajxrec(2);}); $("#echeances3").click(function(e) { ajxrec(3);}); $("#echeances4").click(function(e) { ajxrec(4);}); $("#echeances5").click(function(e) { ajxrec(5);}); $("#echeances6").click(function(e) { ajxrec(6);}); $("#echeances7").click(function(e) { ajxrec(7);}); $("#echeances8").click(function(e) { ajxrec(8);}); $("#echeances9").click(function(e) { ajxrec(9);}); $("#echeances10").click(function(e) { ajxrec(10);}); $("#echeances11").click(function(e) { ajxrec(11);}); $("#echeances12").click(function(e) { ajxrec(12);}); $("#echeances13").click(function(e) { ajxrec(13);}); $("#echeances14").click(function(e) { ajxrec(14);}); }); function ajxrec(param){ $.ajax({ url : datalink, type : 'GET', data: {'endpoint': param }, dataType : 'html', success : function(code_html, statut){ var obj = JSON && JSON.parse(code_html) || $.parseJSON(code_html); var ArrayMeteoIcone = obj["data"]; displayme(ArrayMeteoIcone); displaymetemp(obj["data2"],obj["data3"]); $("#contextmaj").html(obj["infolabel"]); } }); } function displayme(param){ for(var i= 0; i < 45; i++) { $("#icon" + i).attr("class","sprite3 " + param[i] + " temp" + i); } } function displaymetemp(paramM,param){ for(var i= 0; i < 45; i++) { $("#temp" + i).html(paramM[i] + "°
" + param[i] + "°"); $("#temp" + i).attr("class","black temp" + i); } }