I have an xml example:
<LOCAL_AUTHORITY>
<NAME>Derby</NAME>
<REGION></REGION>
<IRD>22%</IRD>
<LOCAL_AUTHORITY>
I have the following javascript:
localAuthorities=xmlDoc.getElementsByTagName("LOCAL_AUTHORITY");
alert(localAuthorities[0].getElementsByTagName("REGION")[0].childNodes[0].nodeValue);
alert('This get triggered so javascript is not broken');
My question is javascript breaks if you don't give the region a value in xml. Good reactions to any respondents. How can I prevent it from breaking?
source
share