title: Is it possible to open a bootstrap modal synchronously and wait for the result?
body: <p>I have a function that pulls up a dialog that the user can optionally interact with or just close.  Canceling the modal should cancel the calling function altogether, but completing the modal changes the outcome of the calling function, so I would like to open the modal and wait for the response, like you would with a forms application or similar.  Is this possible?</p>
  
  <p>The modal is meant to be modular and will not always be called by this function, so I don't want to just call a separate function when the user makes a choice in the modal, but rather return to the previous execution.</p>
  
  <p>Here's the basic idea:</p>
  
  <pre><code>function sendComment() {
      var response = $("#myModal").modal("toggle");
  
      //wait
  
      if (response)
      {
          //do some stuff
      }
      else 
      {
          //do some other stuff
      }
  } 
  </code></pre>