Przekieruj na inną stronę w polu alertu potwierdź [duplikat]
To pytanie ma już tutaj odpowiedź:
Jak przekierować na inną stronę internetową? 58 odpowiedziTo jest część mojej funkcjipytanie w tym:
function deletePost() {
var ask = window.confirm("Are you sure you want to delete this post?");
if (ask) {
window.alert("This post was successfully deleted.");
/* How to redirect to another page on confirm? */
}
}
Potrzebny jest czysty Javascript.