I have a `keyup` function to search for a data on a table. I want to make the loading image appear only **once**. For example, if user type `"one"`, the image will appear only one time until the result appear. 

I'm able to show the image upon `keyup` function but it will appear base on what user type. For example, if user type `"one"`, the image will appear 3 times. Below are the example of my codes,

```
$("#search").keyup(function(){
    var search = $("#search").val();
    $("#loading").fadeIn(500);
    $.post('search_pr.php',
    {
        search : search
    })
    .done(function(data){
        $("#loading").fadeOut(500);
        $("#body").html(data);
    });  
});

```