答案 0 :(得分:0)
尝试这样的事情:
$(document).ready(function () {
$('#tur').click(function () {
$.ajax({
url: "gelirturugetir.php",
method: POST, //because your php awaiting POST
data: 'key=val',
dataType: 'json',
beforeSend: function( xhr ) {
//do some staff before request start
$("#my-textbox-id").show(); //show textbox
}
}).done(function (json) {
//do some staff after request complete
console.log(json);
$("#my-textbox-id").hide(); //hide textbox
});
})
})
因为您的ajax请求需要JSON数据类型作为答案,所以在服务器端添加适当的标头:
...
header('Content-Type: application/json');
echo json_encode($Verilter);
?>