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 28 29 30 31 32
| var arg = 'oreonPath=<?=$oreon->optGen["oreon_path"]?>&host_id='+idTemp;
var xhrT = getXhrTrap();
xhrT.open("POST","./modules/cdm/Ajax/GetXMLComposant.php",true);
//xhrT.setRequestHeader('Content-Type: text/xml',' charset=ISO-8859-1');
xhrT.setRequestHeader('Content-Type: text/xml','application/x-www-form-urlencoded');
xhrT.send(arg);
xhrT.onreadystatechange = function()
{
if(xhrT && xhrT.readyState == 4 && xhrT.status == 200 && xhrT.responseXML)
{
reponseT = xhrT.responseXML.documentElement;
var hosts = reponseT.getElementsByTagName("host");
var selbox = document.getElementById("comp_host");
while ( selbox.options.length > 0 )
{
selbox.options[0] = null;
}
for (var i = 0 ; i < hosts.length ; i++) {
var host = hosts[i];
//ERREUR A LA LIGNE SUIVANTE :
var id = host.getElementsByTagName("id")[0].firstChild.nodeValue;
//
var name = host.getElementsByTagName("name")[0].firstChild.nodeValue;
new_elem = new Option(name,id);
selbox.options[selbox.length] = new_elem;
}
} |