如何在甜蜜警报

时间:2018-03-27 11:17:29

标签: javascript html jsp sweetalert

如何在甜蜜警报中打开新窗口中的网址

2 个答案:

答案 0 :(得分:0)

你可以使用" window.open(URL,name,specs,replace)"在其他窗口打开。例如:

swal({
  title: "Are you sure?",
  text: "You redirect in the new window in other page!",
  type: "warning",
  showCancelButton: true,
  confirmButtonClass: "btn-danger",
  confirmButtonText: "Yes, delete it!",
  cancelButtonText: "No, cancel plx!",
  closeOnConfirm: false,
  closeOnCancel: false
},
function(isConfirm) {
  if (isConfirm) {
    window.open("https://www.google.com");
  } else {
    window.open("https://www.yahoo.com");
  }
});

答案 1 :(得分:-1)

使用查询者br_em _blank:

\