选项卡选择的确认

时间:2016-07-20 06:42:48

标签: javascript jquery html browser twitter-bootstrap-3

我有一个带有引导选项卡的页面来显示数据。在该页面中,当用户离开页面时,使用以下脚本显示确认

enter image description here

$(window).bind('beforeunload', function() { 
      return settings.unsavedAlertMessage;  //which is transalated in the application
});   

但现在我需要在制表符开关上实现相同的确认框。我们使用代码段实现的

$(document).on('hide.bs.tab', '#paneltab', function (e) {
    if(window.confirm('Are you sure')){
        e.preventDefault();
    }
})  

enter image description here

但确认框与第一个不同。我需要获得相同的确认框,因为浏览器将处理文本的翻译。 如何获得相同的确认框

0 个答案:

没有答案