I’m using this code to load twitter’s web intent javascript functionalities only and only if the share modal is opened:
$(function(){
$('#share').on('show.bs.modal', function(e){
if(typeof(twttr) === 'undefined') {
$.getScript('https://platform.twitter.com/widgets.js');
}
});
});
It works great. Now, I also want to completely remove the show.bs.modal event from the modal once it has been triggered for the first time, because it will be completely unnecessary afterwards.
I already tried:
$('#share').off('show.bs.modal');
but I’m guessing that since it’s not a standard event, it won’t work like that. Also, I’ve searched for event removal methods in the bootstrap docs, but it doesn’t seem to be anything like that in there.
Any ideas? Thanks!
2
Answers
I guess it’s all about event type of modal window.
Probably you meant
shown.bs.modal
instead ofshow.bs.modal
.