title: How can you pass a variable to Bootbox confirm?
body: <p>Is it possible to pass a jQuery variable into a bootbox.js confirm box?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>bootbox.confirm({
  message: 'Are you sure you want to remove [productName]?',
  callback: function(result) {
      console.log(result);
  },
  title: "You can also add a title",
  });
  </code></pre>
  
  <p>Where "productName" is a variable like:</p>
  
  <pre><code>var productName = $('#product_name').val();
  </code></pre>
  
  <p>Is something like this possible? </p>
  
  <p>UPDATE: Thanks for the answer below!</p>
  
  <p>Tacking onto this question.... if I had something like this:</p>
  
  <pre><code>$('#product_name1 a.trash').click(function(event){
  
  event.stopImmediatePropagation();           
  event.preventDefault();
  
  var foo = $(this).parent().attr('id');  // #product_name1
  
  alert(foo); // correct!
  
  bootbox.confirm({
  message: 'Are you sure you want to remove [productName]?',
  callback: function(result) {
     if (confirmed) 
      alert(foo); // undefined!
     }
  }
  
  });
  
  });
  </code></pre>
  
  <p>How do I redefine "this" inside the callback? "foo" returns undefined because it's referring to bootbox now.</p>