I have the xml which is loaded in http.responseXML. The XML can either contain a node called "field" or a node called "error" depending on if the validation was successful. I want to check if there is a node called error so I am using the following code:
This works ok but generates a javascript error in the console which states:
http.responseXML.getElementsByTagName("error")[0] has no properties
If the error node doesn't exixst. Is there better IF logic that can avoid this error please?
-Geeeeeeeeeeeeeeeeeeeeeeee-
-=
Code:
if (http.responseXML.getElementsByTagName('error')[0].getAttribute("value")) {
This works ok but generates a javascript error in the console which states:
http.responseXML.getElementsByTagName("error")[0] has no properties
If the error node doesn't exixst. Is there better IF logic that can avoid this error please?
-Geeeeeeeeeeeeeeeeeeeeeeee-
-=