How to use link instead of alert?

Here is my code

function destroy()
{
    if (confirm("Are you sure?")) {
        alert("User will be deleted")
    }

    else {

    }

}

But I don't want to show alert message, I want the user to be redirected by my own link. What should I write instead of alert to do that ?


if (confirm("Are you sure?")) {
    window.location = 'your_link_here';
}
链接地址: http://www.djcxy.com/p/34744.html

上一篇: jQuery验证成功后,页面不会在特定位置重定向

下一篇: 如何使用链接而不是警报?