XMLHTTPREQUEST and jquery cycle

XMLHTTPREQUEST and jquery cycle

Hello,
I'm trying to use the Jquery cycle function in a XMLHttpRequest function.
After having fetch the image values from a XML in a "listeProduits" array, I'm putting them into a div which will be use for the jquery cycle function.

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 language="javascript" type="text/javascript">');
htmlDiapo.push("$(function() {$('#"+idDiaporama+"').cycle();});");
htmlDiapo.push("</script>");

}
htmlDiapo.push("</tr></table>");

idZone.innerHTML = htmlDiapo.join("");

}



regards,


Damien Hirlimann