My idea: Click on a contact in the list and the detailed information of that contact will automagically (that’s a technical term) appear on the right hand side of the screen along with an edit and a delete button. Well I figured since I was taking the time to do this with asynchronous javascript, I would go ahead and throw in some XML so I could say “whoa dude, my site is totally rad because it uses AJAX and is part of the totally hip and cool web 2.0! That’s why you should totally use it!” Now enter reality: I got my PHP script to produce the XML really easily and I started to think that maybe adding XML to this stuff would be easy. Enter XML. It is kicking my ass! Why is it so difficult for me to read the XML node values? I can traverse the XML node tree just fine:
xmlObj = xmlDoc.documentElement;var children= xmlObj.childNodes;var length = xmlObj.childNodes.length;for(var i=0; i alert(children[i].tagName+”= “+children[i].nodeValue);}
the children[i].nodeValue is always returning null or blank when I can see that my XML file has data in it! Another odd thing is that the length (which is the number of children nodes of the XML file) is 21! WTF?! There is the root node and 11 children nodes. I’m confused…and the normally helpful web (and google) is not being especially friendly today. Damn the luck…