1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
$.getJSON('ajax_prog.php?plaque='+$("#plaque option:selected").val(),
function(data) {
var retour = new Array();
retour.push("<TABLE>");
retour.push("<THEAD>");
retour.push("<TR>");
// ligne d'entête pour gérer les tris ?
retour.push("</TR>");
retour.push("</THEAD>");
retour.push("<TBODY>");
var nbLignes = data.length;
for (i=0;i<nbLignes;i++)
{
retour.push("<TR>");
var nbCellules = data[i].length;
for (j=0;j<nbCellules;j++)
{
retour.push("<TD>"+data[i][j]+"</TD>");
}
retour.push("</TR>");
}
retour.push("</TBODY>");
retour.push("</TABLE>");
$('table').innerHTML = retour.join("");
} |
Partager