我想在我的 ajax 调用返回成功后重定向。我试过 window.location
, window.location.href
,self.location
但页面没有重定向到目标页面。这是我所有的ajax邮政编码:
$(document).on('click', '.btn_Yeni', function (event) {
var date= $("#deSeansTarihi").val();
var _iHastaId= $("#hdnHastaId").val();
date= date.toString().substring(3, 5) + "." + date.toString().substring(0, 2) + "." + date.toString().substring(6, 10);
$.ajax({
type: "POST",
url: "KlinikHastalari.aspx/SetNewData",
data: JSON.stringify({ _dtTarih: date, _id: _iHastaId}),
dataType: "json",
async: true,
contentType: "application/json; charset=utf-8",
success: function (msg) {
window.location("http://localhost:59508/trunk/abs.aspx?hid=" + _iHastaId);
}
});
});
SetNewData 函数返回成功。我应该怎么做才能重定向目标页面?