如何在Bootbox / Bootstrap确认窗口中编辑链接按钮

时间:2015-07-08 21:25:37

标签: jquery twitter-bootstrap bootbox

我有一个简单的bootbox / javascript确认窗口:

https://www.guard-gate.com/test2/index.html

如何编辑Sucess指向google.com的链接?

我被告知以下内容:

window.location.href = "http://www.google.com";

但是我必须将其添加到代码中,如下所示吗?

  buttons: {
    success: {
  label: "Success!",
  className: "btn-success",
  callback: function(window.location.href = "http://www.google.com";) {
    Example.show("great success");

1 个答案:

答案 0 :(得分:1)

您的代码将是

buttons: {
    success: {
      label: "Success!",
      className: "btn-success",
      callback: function() {
         window.location.href = "http://www.google.com";
      }
   };