title: bootstrap remote modal remove javascript
body: <p>i have modals in my bootstrap application. the modals get their content from a dataremote source. In this modal I defined some javascript functions.</p>
  
  <p>my problem is, when i close the modal and open it again the javascript code is available twice. That means the on click event will be performed multiple times.</p>
  
  <p>Is there a possibility to clear the modals javascript code on hide?</p>
  
  <p>I also use </p>
  
  <pre><code>$('body').on('hidden', '.modal', function () {
    $(this).removeData('modal');
  });
  </code></pre>
  
  <p>to prevent from showing the same content again</p>