I don't know why the console return me this uncaught syntax ... Help me plz !
$(document).ready(function() {
$("#idval").change(function() {
var id = $(this).val();
$.ajax({
url: 'verif.php',
type: 'GET',
data: 'user=' + id,
success: function(server_response) {
var session = $(server_response).html();
if (id == session) {
console.log($("#" + d));
} else {
console.log("You shall not pass!");
}
},
error: function(server_response, statut, error) {
console.log("Can't be linked !");
}
});
});
});
When the user enter an id, the server check if the id is on the database. If it is, the server return the id in the console if it isn't, the server should return "string", but it return the uncaught ....
var session = $(server_response).html();? (Which is, btw, almost certainly the problem.) If you just want the text, just useserver_responsedirectly.