未通过有错的情况下。
var success = 1, newWindow = window.open();
$.ajax({
url: url,
data: data,
type: 'POST',
async: false,
success: function (data) {
success = data.success;
if (success == 0) {
//TO DO
} else {
//TO DO
}
}
});
if (success == 0) {
//TO DO
} else {
newWindow.close();
}
使用同步打开