title: Capture close event on Bootstrap Modal
body: <p>I have a Bootstrap Modal to select events.
  If the user clicks on the X button or outside the modal, I would like to send them to the default event.
  How can I capture these events?</p>
  
  <p>This is my HTML code:</p>
  
  <pre><code>&lt;div class="modal" id="myModal"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content event-selector"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;x&lt;/button&gt;
                  &lt;center&gt;&lt;h1 class="modal-title event-selector-text"&gt;Select an Event&lt;/h1&gt;&lt;center&gt;
              &lt;/div&gt;
              &lt;div class="container"&gt;&lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="event-banner"&gt;
                      &lt;a href="/?event=1"&gt;
                          &lt;img src="&lt;?php echo IMAGES_EVENT1_LOGO; ?&gt;" width="100%"&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="event-banner"&gt;
                      &lt;a href="/?event=2"&gt;
                          &lt;img src="&lt;?php echo IMAGES_EVENT2_LOGO; ?&gt;" width="100%"&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>