I have a page which shows a HTML table filled with MySQL data, with a search input field above it.  

When I use that search (keyup) a AJAX script is called and the table contents are reduced with the search results. So far so good.

Only when I clear the search field I want show the **original** HTML table back again.
I think the problem is that the last character of the GET-variable can't be backspaced/removed.  

**EXAMPLE:**

```
.../search.php?search=word
.../search.php?search=wor
.../search.php?search=wo
.../search.php?search=w

```

So instead of returning to the original table state, it keeps showing me all entries containing a 'W'.

My search.js: 

```
$(document).ready(function() {
    $('#spelerzoeken').keyup(function() {
        var speler = $(this).val();

        if (speler !== '') {

            $.ajax({
                url: 'includes/search.php?search=' + speler,
                success: function(returnData) {
                    if (!returnData) {
                        $('.spelers').html('<span style="margin-top: 20px; margin-bottom: 20px; margin-left: 10px; display: block; width: 200px">Geen speler(s) gevonden.</span>');
                    } else {
                        $('.spelers').html(returnData);
                    }
                }
            });
        }
    });
})

```