does anyone know if/why XML parser doesn't parse after its elemet has been created? It doesnt work with ......
At least so it seems to be
look!!
(cd_catalog.xml can be found at
http://www.w3schools.com/xml/cd_catalog.xml)
window.document.getElementById("xcd").innerHTML=xmlhttp.responseXML
..... too or variants (maybe I've forgotten some!)
<!
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<xml id="xcd"></xml> <title>Nice</title> <script type="text/javascript"> var xmlhttpfunction
loadXMLDoc (url){
xmlhttp=
null if (window.XMLHttpRequest){
xmlhttp=
new XMLHttpRequest()}
else if (window.ActiveXObject){
xmlhttp=
new ActiveXObject("Microsoft.XMLHTTP")}
if(xmlhttp!=null){
xmlhttp.onreadystatechange=state_change
xmlhttp.open(
"GET",url,false)xmlhttp.send(
null)}
else{
}
}
function state_change(){
if (xmlhttp.readyState==4){
// if "OK"alert(
"Status: "+ xmlhttp.status) if (xmlhttp.status==200){
window.document.getElementById(
"xcd").innerHTML=xmlhttp.responseText}
}
}
function gonext(){
x=xcd.recordset
if (x.absoluteposition<x.recordcount){
x.movenext
}
}
function goprev(){
x=xcd.recordset
if (x.absoluteposition>1){
x.moveprevious
}
}
</script></
head><
body onload="loadXMLDoc('cd_catalog.xml')"> <div>Titolo:
<span datasrc="#xcd" datafld="TITLE"></span> <br />Artista:
<span datasrc="#xcd" datafld="ARTIST"></span> <br /> </div> <div > <input type="button" value="Next" onclick="gonext()" /> <input type="button" value="Prev" onclick="goprev()" /> </div></
body></
html>
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.