这是我的ajax请求
$.ajax({
type: "POST",
url: "Performance.aspx/GenerateMatrix",
data: '{OrgId: ' + $('#hidOrgId').val() + ',SurveyFormId: ' + $('#divMatrixInfo .FeedbackForm').val() + ',GoalId: ' + $('#divMatrixInfo .FeedbackGoal').val() + ',StartDate: ' + "'" + StartDateTime + "'" + ',EndDate: ' + "'" + EndDateTime + "'" + ',EmployeeId: ' + "'" + $('#divMatrixInfo .FeedbackEmployee').val() + "'" + ',QuestionId: ' + "'" + $('#divMatrixInfo .FeedbackQuestion').val() + "'" + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
CloseModelOverLay('divMatrixInfo');
window.open('GenerateMatrix.aspx', '_blank');
$('#ddlPDPView').val('Goals');
$('#ddlPDPView').change();
},
failure: function (response) {
alert(response.d);
}
});
我想通过此
打开GenerateMatrix.aspx以在新标签中打开window.open('GenerateMatrix.aspx', '_blank');
但是它会在新的弹出窗口中打开。
答案 0 :(得分:2)
试试这个:
var newWindow = window.open('http://www.example.com','_blank');
$.ajax({
type: "POST",
url: "Performance.aspx/GenerateMatrix",
data: '{OrgId: ' + $('#hidOrgId').val() + ',SurveyFormId: ' + $('#divMatrixInfo .FeedbackForm').val() + ',GoalId: ' + $('#divMatrixInfo .FeedbackGoal').val() + ',StartDate: ' + "'" + StartDateTime + "'" + ',EndDate: ' + "'" + EndDateTime + "'" + ',EmployeeId: ' + "'" + $('#divMatrixInfo .FeedbackEmployee').val() + "'" + ',QuestionId: ' + "'" + $('#divMatrixInfo .FeedbackQuestion').val() + "'" + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
CloseModelOverLay('divMatrixInfo');
newWindow.focus();
$('#ddlPDPView').val('Goals');
$('#ddlPDPView').change();
},
failure: function (response) {
alert(response.d);
}
});