views:

12

answers:

0

Hi,

For my xml object I have 3 nodes which I can grab. I'm trying to make a search box where the result is a link. I'd like to format what is shown in the drop down to be like this:

Title (which is also a link provided by the URL node)
  Description

I am able to get the data but how do I format the results to look like that? I'd also like to add a span class to each of the results so I can mark them up with css. Something like <span class='title'> $("SC_DF_FIELD_1", this).text() </span>

Thanks.

$.ajax({
url: "links2.xml",
dataType: "xml",
success: function(xmlResponse) {
var data = $("ROW", xmlResponse).map(function() {
 return {
  value: $("SC_DF_FIELD_1", this).text() + $("SC_DF_FIELD_2", this).text()

 };
}).get();