Skip to content Skip to sidebar Skip to footer

Redirect To Other Page On Alert Box Confirm

This is a piece of my function with the question in it: function deletePost() { var ask = window.confirm('Are you sure you want to delete this post?'); if (ask) { w

Solution 1:

try this:

function deletePost() {
    var ask = window.confirm("Are you sure you want to delete this post?");
    if (ask) {
        window.alert("This post was successfully deleted.");

        window.location.href = "window-location.html";

    }
}

Post a Comment for "Redirect To Other Page On Alert Box Confirm"