highlight text pulled from function
i'm building a really simple mashup using twitter api / jquery / json
everything's working perfectly but i want to highlight my search terms (there are multiple terms separated by 'OR' in the query) in the results.
I found the jquery highlight mentions across a few tutorials and spaces, but they mostly refer to search results and inline styling instead of styling applied within the function.
i'm a complete newbie to jquery, and trying to learn as i go, but i'd appreciate someone much cleverer than i to point me in the right direction for both a tutorial, but in the short term, some advice on where to stick my code!
what i have is here (i've not included the highlight code, as it's a pretty standard function and i'm pretty sure i had it all wrong anyways)
-
$(function(){
var search_term = 'term1 OR term2 OR term3';
$.twitter.liveSearch(search_term, {rpp:5, channel_name:'foobar'}, function(resp){
$(resp.results).each(function(){
$('#box1').prepend('<div class="foo" id="'+this.id+'">\
<a href="http://twitter.com/'+this.from_user+'">\
<p>'+this.text+'</p></a>\
</div>');
$('#'+this.id).hide();
$('#'+this.id).fadeIn('slow');
$('#box div:gt(5)').each(function(){
$(this).fadeOut('fast');
});
});
});
);
});
Thanks!!