[jQuery] parsing ajax html responses

[jQuery] parsing ajax html responses


Hi,
I am trying to accomplish something with the cluetip plugin, but it
really has more to do with parsing ajax html responses.
What I have is a search results page. I am using the href attribute as
the url for my ajax request. What I get back is a fully formed html
document as a string. The default behavior of the cluetip plugin is to
populate the tooltip with that entire response (minus the meta, title,
script etc. tags).
What I really want is the contents of the meta description tag in the
response to populate the tooltip. Unfortunately parsing a fully formed
html string isn't as easy as an xml string. I tried $
(data).find(meta[@name=description]).attr('content'); but that didn't
work.
I think the area of the plugin settings I need to mettle with is:
// process data retrieved via xhr before it's displayed
ajaxProcess: function(data) {
// I want the contents of the meta description tag
//data = $
(data).find(meta[@name=description]).attr('content');
data = $(data).not('style, meta, link, script,
title');
return data;
}
Any suggestions out there?
Thanks,
-Dan