$(document).ready(function() {
    
    $("#username").on("change", function(event) {
        var username = new String();
        username = $('#username').val()
        $('#validateusername').html('<img src="/authenticate/images/ajax-loader.gif">').load('/authenticate/validateusername?username='+username);
    });
});