[jQuery] jquery cycle in a httpRequest

[jQuery] jquery cycle in a httpRequest


Hello,
I'm trying to use the Jquery cycle function in a httpRequest.
After having get the values in a "listeProduits" array, I'm trying to
put them in a table.
It appears corretly but the cycle function doesn't work.
Here is the function
Anyone has an idea ?
function creerDiaporama (listeProduits) {
            var nbrProduits = listeProduits.length;
            var nbrDiaporama = Math.ceil(nbrProduits/5);
            var dureeSupp = 500;
            var jinitial=0;
            var idZone = document.getElementById("zone");
            htmlDiapo.push("<table><tr>");
    for (var i=0;i<nbrDiaporama;i++) {
            htmlDiapo.push("<td>");
            var idDiaporama = "diaporama"+i;
            htmlDiapo.push("<div id='"+idDiaporama+"' class='pics'>");
            for (var j=jinitial;j<nbrProduits;j++) {
                htmlDiapo.push("<img src='images/"+listeProduits[j]
+".jpg' width='80' height='102' alt='"+listeProduits[j]+"' />");
                    if (j== (((i+1)*5)-1)) {break;}
                }
            htmlDiapo.push("</div>");
            jinitial += 5;
            htmlDiapo.push("</td>");
            htmlDiapo.push("<script type='text/javascript'>");
            htmlDiapo.push("$('#"+idDiaporama+"').cycle();");
            htmlDiapo.push("</script>");
        }
            htmlDiapo.push("</tr></table>");
            idZone.innerHTML = htmlDiapo.join("");
    }
regards,
Damien Hirlimann