I’m working on a simple AJAX script that looks at a dynamic calendar and rewrites a DIV with the code from an XML file that’s created via a ColdFusion file.
I have the AJAX part working by looking at ‘responseText’ from the XMLHttpRequest call, but when I try and look at the ‘responseXML’ I run into issues. Here is the code:
var myitem = http.responseXML.childNodes[1].childNodes[1];
var myresult = "<ul>";//myitem.childNodes[8].length;
for(i=0;i<12;i++){
var v = myitem.childNodes*;
myresult += "<li>" + i + " - " + v.nodeName + " - " + v.nodeValue + "";
}
myresult += "</ul>done";
document.getElementById('foo').innerHTML = myresult;
This returns the following:
[list]
[]0 - #text -
[]1 - title - null
[]2 - #text -
[]3 - link - null
[]4 - #text -
[]5 - description - null
[]6 - #text -
[]7 - image - null
[]8 - #text -
[]9 - item - null
[]10 - #text -
[]11 - item - null
[/list]Though I KNOW that I have values for this, as the XML is this:
http://www.scad.edu/customcf/displayCalendar.cfm?mode=rss&category=21
What gives? How do I actually grab the text in those nodes?