I have a problem in my code . This is part of it:
function checkIfAvailable(username){
var url = \"/checkAvail?user=\"+username;
var ans = $.ajax({
url
function checkIfAvailable(username) {
var ans = $.ajax({
url: "/checkAvail",
type: "GET",
data: "user=" + username,
dataType: "html",//change it by the data type you get (XML...)
context: document.body,
statusCode: {
404: function() {
console.log("-1-1-1-1 WE GOT 404!");
},
200: function() {
console.log("-1-1-1-1 WE GOT 200!");
}
},
success: function() {
console.log("success");
},
error: function(e) {
alert(e);
}
});
}