byqdez
Новичок
ajax + xml
Есть xml : <option value="test">testvalue</option>
Я получаю его через httpRequest, конвертирую в DOM
и пытаюсь всунуть через appendChild в существующий select.
в debug пишет: Node cannot be inserted at the specified point in the hierarchy" code: "3
Исходник:
Есть xml : <option value="test">testvalue</option>
Я получаю его через httpRequest, конвертирую в DOM
и пытаюсь всунуть через appendChild в существующий select.
в debug пишет: Node cannot be inserted at the specified point in the hierarchy" code: "3
Исходник:
PHP:
<SCRIPT LANGUAGE="JavaScript">
<!--
getRoles();
function getRoles(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","http://test/admin/administration/user/http_req/",true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
zzz = (new DOMParser()).parseFromString(xmlhttp.responseXML, "text/xml");
myselect = document.getElementById('role_id');
myselect.appendChild(zzz);
}
}
xmlhttp.send(null);
}
// -->
</SCRIPT>