The variable data is not updated when you change the value of your input field, but only once: when the document is loaded.
Use this instead of your source option:
source: function(request, response) {
$.ajax({
url : 'ajax.php',
type : 'post',
dataType: 'json',
data : 'location=' + request.term,
cache : false,
success : function(data) {
response(data);
}
});
}