I am trying to create a wrapper function for Bootstrap Modal, I have gone through the actual modal function definition but I am unable to figure out how to instantiate a Modal by using JS.
HTML:
<div class="modal"></div> <!--I DON'T WISH TO HAVE ANYTHING ELSE ON THE PAGE-->
JS:
var BSModal = {};
BSModal.create = function(options) {
var modal = new Modal($('.modal'), options); //THROWS ERROR, Modal not defined.
...
}.bind(BSModal);
How do I properly instantiate the modal? What am I doing wrong?
According to https://github.com/twbs/bootstrap/blob/master/js/modal.js
so i believe you can use something like this in your code