Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. kneeboarder

    Checking if node exists before accessing data

    thanks tsuji :)
  2. kneeboarder

    Checking if node exists before accessing data

    someone has suggested this var el = x[i].getElementsByTagName("fieldname")[0]; if (el.childNodes && el.childNodes.length > 0) { // access the nodeValue } else { // don't }
  3. kneeboarder

    Checking if node exists before accessing data

    If I'm looping through the xml and using getElementsByTagName - x[i].getElementsByTagName("fieldname")[0].childNodes[0].nodeValue is there a way of checking whether that node exists? This errors if the field is empty or the field doesn't exist at all so I want to test first before trying to...

Part and Inventory Search

Back
Top