我需要一些帮助,以便在jquery中打开新选项卡的href链接。我得到以下resuts,如果点击以下链接立即付款我从RtObject获得结果.ReturnVal.my结果成功获得以下结果显示在新选项卡中。 $(function(){ $(" #OrderTable> tbody> tr> td> .paynow")。点击('点击',功能(Myevent){
Myevent.preventDefault();
var passval = $(this).parents().siblings('td:eq(1)').text();
$.ajax({
type: "POST",
datatype: "json",
async: true,
url: '/MyAccount/PayNow?OrderId=' + passval,
contentType: "application/json; charset=utf-8",
success: function (RtObject) {
//alert(RtObject.isError);
//alert(RtObject.CId);
if (!RtObject.isError) {
//alert(RtObject.isError);
if (RtObject.CId == 1) {
var newwin;
if (newwin && !newwin.closed) {
newwin.focus();
} else {
$(this).target = "_blank";
window.location = RtObject.ReturnVal;
}
}
else if (RtObject.CId == -1) {
jAlert(RtObject.Message, "Failure");
}
}
},
failure: function (response) {
jAlert("Cant go to payment process", "Failure");
}
});
});
请帮我解决这个问题。
答案 0 :(得分:0)
取而代之的是window.location = RtObject.ReturnVal
;使用window.open(RtObject.ReturnVal, '_blank');