I'm having a problem I made a Javascript code to display via AJAX an XML with a list: My XML looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<telas>
<item>
<title>Lorem ipsum</title>
<title>Dolor sit amet</title>
</item>
<item>
<title>Lorem ipsum dolor</title>
<title>Ipsum dolor sit amet</title>
<title>Ipsum dolor sit amet</title>
</item>
</telas>
I want to list the content of the <item>
(of XML) tag and put the <li>
(in my HTML) tag in the <title>
(of XML), but only shows the contents of the first tag title
, I need it to show all the <title>
tags I have in XML.
I think the problem is this part of my code:
exibir+=tela[valor].getElementsByTagName('title')[0|1].firstChild.nodeValue;
How can I change this to work properly (the one I want)?