i have modals in my bootstrap application. the modals get their content from a dataremote source. In this modal I defined some javascript functions.
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.
Is there a possibility to clear the modals javascript code on hide?
I also use
$('body').on('hidden', '.modal', function () {
$(this).removeData('modal');
});
to prevent from showing the same content again