I'm working with Bootstrap and jQuery, and I've got the modal content working fine using the text attributes to trigger the open.
However, I am trying to close the open modal window from another script and I get the error that modal is not defined
:
modals.js:94 Uncaught TypeError: $(...).modal is not a function(anonymous function) @ modals.js:94dispatch @ jquery.min.js:3r.handle @ jquery.min.js:3
modals.js:86 Object {__ob__: Observer, __v-for__1: Fragment}
The code looks like this:
$('#mymodal').modal('hide');
The loading order of the js files is:
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script>
<script src="/modals.js" type="text/javascript"></script>
How is modal not defined if the modal window works properly from the data-toggle="modal"
call?
cetver :
Probably other script rewrites bootsrap modal function $.fn.modal\n\nIf it true you need to resolve conflict:\n\nvar bootstrapModal = $.fn.modal.noConflict();\n$.fn.bootstrapModal = bootstrapModal;\n$('#mymodal').bootstrapModal('hide');\n",
2016-07-21T22:32:59