Hi All, I am naive jQuery programmer, so somebody please help me out with this problem. The first example shows what i am doing and its working. But my dilemma is that the list is created by parsing a XML. If so how would i parse the xml, find the 'title' attribute and then load the corresponding url into a Div. Thanks in advance...
jQuery code
$('.treeLinks').click(function() {
var sourceURL = $(this).attr('title');
$('#content').load(sourceURL);
});
Corresponding HTML Code
<ul>
<li><a href="#" title="contentArea1.html" class="treeLinks">Link 1</a></li>
<li><a href="#" title="contentArea2.html" class="treeLinks">Link 2</a></li>
</ul>
XML code which needs to be parsed for getting the title attribute
<?xml version="1.0" encoding="UTF-8"?>
<root>
<item id="pxml_1">
<content><name class="treeLinks"><![CDATA[Root node 1]]></name></content>
<item id="pxml_2">
<content><name class="treeLinks"><![CDATA[Child node 1a]]></name>
<item id="pxml_23">
<content><name><![CDATA[Child node 1a]]></name></content>
</item>
</content>
</item>
<item id="pxml_3">
<content><name><![CDATA[Child node 2b]]></name></content>
</item>
<item id="pxml_4">
<content><name><![CDATA[Child node 3c]]></name></content>
</item>
</item>
</root>