I am currently working on a function with jQuery that searches for the class that was just clicked within xml. But the result only seems to parse me the last entered result. I keep struggeling to get this fixed so I hope someone on sitepoint is able to help me out.
The jquery looks like this:
$(".links dd").live("click",function(){
var linkName = $(this).attr('class');
description(linkName);
});
function description(x){
$(".description").replaceWith('<div class="description">' + description + '</div>');
}
and the XML tree like this:
<linklist>
<link title="sitepoint">
<class>sitepoint</class>
<url>#/sitepoint/</url>
<description> This is a excellent site to get help </description>
</link>
<link title="google">
<class>google</class>
<url>#/google/</url>
<description> The most used search engine nowadays </description>
</link>
</linklist>
In this case it would only show me the description of Google, even when I click to see the information/description about sitepoint.
Thanks in advance,
Mehk