网络输出:
function view_cet() {
var action = "select";
var fname = $("#fname1").val();
var lname = $("#lname1").val();
var bdate = $("#bdate1").val();
var type = "C";
if (fname != '' && lname != '' && bdate != '') {
$.ajax({
url: "../include2/fetch-cet-sase.php",
method: "POST",
dataType: "json",
contentType: "application/x-www-form-urlencoded",
data: {
action: action,
fname: fname,
lname: lname,
bdate: bdate,
type: type
},
success: function(data) {
$("#output").html(data);
console.log(data);
}
});
} else {
alert('First name, Last name and Date of birth should not be empty. Pleas input a value.');
}
}
答案 0 :(得分:0)
使用Jquery.post()
解决了这个问题
$.post( "../include2/fetch-cet-sase2.php",
{ fname: fname, lname: lname, bdate: bdate, reqtype: reqtype })
.done(function( data ) {
$("#output").html(data);
$("#btn-modal1").click();
});

无论如何,谢谢你的回复:)