jQuery storing the last input value and comparing against new
<p>A function called "checkUsername" executes when I focusout of a input box with the id "regUsername"</p>

<pre><code>$('#regUsername').focusout(function(){
    checkUsername();
});
</code></pre>

<p>The function:</p>

<pre><code>function checkUsername(){
    var form_data = { username : $('#regUsername').val() };
    $.ajax({
        url: "/register/validateUsername",
        type: 'POST',
        data: form_data,
        success: function(msg) {
            var obj = $.parseJSON(msg);
        },
        error: function(data){
            dbdown();
        }
    });
}
</code></pre>

<p>Currently every time you focusout of the input box the ajax post function will run. This causes a slight flicker on returned validation box. I was wondering if it is possible to keep the last instance of the value which was passed in and then compare it with the new value passed in. If they are the same then there would be no need for an ajax post. </p>

<p>Any help on this would be much appreciated :)</p>
