function initUI() {
    $results = $("#results");
    $("#search").keyup(function() {
        $results.empty();

        // Only trigger a search when 2 chars. at least have been provided
        var query = $(this).val();
        if (query.length < 2) {
            return;
        }

        var results = search(query);

        renderResults(results);
    });
}
// Nothing crazy here, just hook up a listener on the input field
Nothing crazy here, just hook up a listener on the input field
Nothing crazy here just hook up a listener on the input field
function initUI() {
    $results = $("#results");
    $("#search").keyup(function() {
        $results.empty();
        var query = $(this).val();
        if (query.length < 2) {
            return;
        }
        var results = search(query);
        renderResults(results);
    });
}
function initUI ( ) { $results = $ ( "#results" ) ; $ ( "#search" ) . keyup ( function ( ) { $results . empty ( ) ; var query = $ ( this ) . val ( ) ; if ( query . length < 2 ) { return ; } var results = search ( query ) ; renderResults ( results ) ; } ) ; }
Nothing crazy here, just hook up a listener on the input field
Nothing crazy here just hook up a listener on the input field
// Only trigger a search when 2 chars. at least have been provided