document.getElementById("registro").innerHTML ='<p>'+ xml.getElementsByTagName('nombre')[contador].firstChild.nodeValue+'</p>';
como podria hacer para mostrar un mensaje cuando el archivo xml no contenga ningun valor las etiquetas nombre?
el codigo js es este:
Código Javascript:
Ver original
function MostrarNombres() { try { document.getElementById("registro").innerHTML ='<p>'+ xml.getElementsByTagName('nombre')[contador].firstChild.nodeValue+'</p>'; contador ++; } catch(e) { contador=0; document.getElementById("registro").innerHTML ='<p>'+ xml.getElementsByTagName('nombre')[contador].firstChild.nodeValue+'</p>'; contador ++; } }
Se agradece cualquier ayuda, saludos.