php – Get an answer with AJAX jQuery, it will not succeed!

I'm doing this query from AJAX jQuery, because I'm doing a PHP, AJAX, JQUERY test, the problem is I'm trying to ask the server to send data from the user's fields and a password, but I always go to the error instead of success, in $ .ajax (), what's going on here?

// JQuery Code 3.3.1

$ (# Send). click (function () {

$ .ajax ({
method: "post"
url: "login.php",
data type: "html",
data: user: {$ (# user). val ()},
success: function (answer) {
$ (& # 39 ;. alertArea p). text (answer);
}
error: $ (& # 39 ;. alertArea p). text ("An error occurred while sending data.!");
});

});
/ * CSS Code * /

* {
margin: 0;
padding: 0;
}
Entrance {
padding: 10px;
}
h2 {
font family: "trebuchet ms";
}
.alertArea {
display: none;
}
.alertArea p {
background: # 333;
}







	
	
	Shape images



	

Log in