Im parsing an xml file with javascript like this :
x = xmlDoc.getElementsByTagName("Name")[0].childNodes[0];
Everything works as expected, except that some times when i dont have an entry "Name" in the xml it shows this error :
xmlDoc.getElementsByTagName("Name")[0] is undefined
which crash my website. Is there any way to check if xmlDoc.getElementsByTagName("Name")[0] has a value and then continue to parse this value to a variable?