我不知道为什么控制台返回给我这个未捕获的语法...请帮帮我!
$(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 !");
}
});
});
});当用户输入id时,服务器会检查该id是否在数据库中。如果是,服务器在控制台中返回id,如果不是,服务器应该返回"string",但它返回未捕获...
发布于 2017-09-29 20:19:15
您没有在代码中声明任何"d“,但您在console.log中使用了它
console.log($("#"+d));但它应该是:
console.log($("#"+id));你错过了i。
https://stackoverflow.com/questions/46488663
复制相似问题