Hi Folks,
iam trying to setup an little search-engine for my website. I want to add an div for each search result. In the moment i do the following :
success: function(data) {
if (data[0] == 'nothing') {
result = $('#search-result');
result.append('<h3>' + LANG.nothing + '</h3>');
$('#ajax-load').empty();
return false;
} else {
jQuery.each(data, function(i, val) {
entry = "<h3><a href='" + val.link + "'>" +
val.title + '</a></h3>' + '<p>' +
val.description + '</p>' + '<p>' +
val.tutorials + '</p>' + "<img src='" +
val.screenshot + "/>";
result = $('#search-result');
result.append("<div class='span-6'>" + entry + '</div>');
});
}
But iam sure, there is an better way with jquery or ?