Javascript 具有特定功能的警报框

Javascript 具有特定功能的警报框,javascript,jquery,Javascript,Jquery,当我第一次离开我的标签时,我得到了一个JS警报框。 但我想得到它作为windows警报-任何想法的基础上,我的代码。 还有一个“确定”和“取消”按钮-OK>Next选项卡 取消>相同选项卡 $(document).ready(function () { B.initB(); var 3firstTimeMsg = true; var 4FirstTimeMsg = true; $(".3a-tab").click(function(){ if(3firstTimeMsg == t

当我第一次离开我的标签时,我得到了一个JS警报框。 但我想得到它作为windows警报-任何想法的基础上,我的代码。 还有一个“确定”和“取消”按钮-OK>Next选项卡 取消>相同选项卡

$(document).ready(function () {
    B.initB();
var 3firstTimeMsg = true;
var 4FirstTimeMsg = true;
$(".3a-tab").click(function(){
    if(3firstTimeMsg == true)
        {
            alert("If you leave this page, any information you've entered will be lost.");
            3firstTimeMsg = false;
        }   
    });
    $(".3b-tab").click(function(){
    if(4FirstTimeMsg == true)
    {
        alert("If you leave this page, any information you've entered will be lost.");
        4FirstTimeMsg = false;
    }
    });
});

这可能是一个确认框:

if(3firstTimeMsg == true) {
    3firstTimeMsg = confirm("If you leave this page, any information you've entered will be lost.");
}