My current code looks like this:
function filter(query) {
if(query != '') {
$("li").each(function(i){
$(this).removeClass('wanted').addClass('unwanted');
});
$.getJSON("$homeadress/suche.php",
{ do: "ajax", type: 'filter', what: 'all', query: query },
function(data){
for ( keyVar in data ) {
var id = '#'+data[keyVar];
$(id).addClass('wanted').removeClass('unwanted');
}
$('li').not('.wanted').addClass('unwanted');
}
);
}
else {
// no real search
$("li").each(function(i){
$(this).removeClass('wanted').removeClass('unwanted');
});
}
}
Any thoughts on this? :-)
dominik
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/