title: Wait for "return value" from Javascript modal
body: <p>OK, I'm by no means a JavaScript guru, and perhaps I'm still thinking in terms of Desktop software development, but this is what I'm trying to achieve :</p>
  
  <ul>
  <li>I'm using <a href="http://twitter.github.com/bootstrap/javascript.html#modals">Twitter Bootstrap's Modals</a></li>
  <li>In some cases, before an action takes place, I want to verify it with a "Are you sure?" (Yes/No) Modal Dialog.</li>
  </ul>
  
  <p><strong>Question :</strong></p>
  
  <ul>
  <li>What should the inner logic be?</li>
  </ul>
  
  <p><strong>I mean :</strong></p>
  
  <ul>
  <li>User clicks buttonA (which ultimately performs actionA)</li>
  <li>I want to launch the modal, wait for the input (either of the 2 buttons - yes/no) and/or pass it to some checking routine before performing(or not) actionA</li>
  </ul>
  
  <p>This my HTML code for the modal (should the buttons be - somehow - acting via their <code>onclick</code> javascript routines?) - also note that <code>#confirmMessage</code> is going to be variable.</p>
  
  <pre><code>&lt;div class="modal fade hide" id="confirmAlert"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;x&lt;/button&gt;
          &lt;h3 id="confirmTitle"&gt;Are you sure?&lt;/h3&gt;
      &lt;/div&gt;
  
      &lt;div class="modal-body"&gt;
          &lt;p id="confirmMessage"&gt;Body&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;a href="#" class="btn" data-dismiss="modal"&gt;Cancel&lt;/a&gt;
          &lt;a href="#" class="btn btn-danger"&gt;Yes&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Just an idea:</strong></p>
  
  <ul>
  <li>Write a function like <code>checkBeforeExec(message,functionToExec)</code></li>
  <li>Set <code>#confirmMessage</code> to message and Yes' href to <code>javascript:functionToExec</code></li>
  <li>Makes sense?</li>
  </ul>
  
  <hr>
  
  <p>I know it may sound a bit confusing - but I simply do not know what the most javascript-friendly way to do this would be...</p>