[jQuery] xpath question
[jQuery] xpath question
Hello all,
Trying to figure out this xpath thing.
I have an xml file at <a href="http://dnatech.informationexperts.com/common/xml/002.xml" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://dnatech.informationexperts.com/common/xml/002.xml
</a>.
I am pulling it in via $.ajax with a dataType of xml.
I go to call the first module's attr 'name' with $('/modules/module[1]', docXML[0]).attr('name'); and I get undefined, but if I do
$('/modules/module', docXML[0]).attr('name');
I get
"Cold Case Background" which is correct, but if I do the following to get the second module<br clear="all">
$('/modules/module[2]', docXML[0]).attr('name');
I get undefined.
Am I missing something. I thought the correct syntax was /modules/module[n] to get the items.
Any direction would be helpful.
--
Benjamin Sterling
<a href="http://www.KenzoMedia.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.KenzoMedia.com</a>
<a href="http://www.KenzoHosting.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.KenzoHosting.com</a>