Bonsoir,
J'ai un petit probleme pour parcourir un document XML, habituellement j'ai un niveau de noeud en plus, ca passe sans problemes, mais la je ne comprends pas le comportement ...
Le code JS :
Le fichier XML :Code:
1
2
3
4
5
6 $.post("/ajax/getid/", { toto: toto }, function success(listid){ $(listid).find('listid').each(function(i, oneid) { alert( $(oneid).find('iduser').text()); }); });
Le probleme, il ne passe une seul fois dans le alert, et donc il m'affiche "12" alors qu'il y a 2 noeuds ... :cry:Code:
1
2
3
4
5
6
7
8 <?xml version="1.0" encoding="iso-8859-1"?> <root> <listid> <iduser>1</iduser> <iduser>2</iduser> </listid> </root>