How to open a url in new window in sweet alert
2 Answers
you can use "window.open(URL,name,specs,replace)" for open in other window. Example:
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");
}
});