Home:ALL Converter>bootstrap and jquery modal failing

bootstrap and jquery modal failing

Ask Time:2016-07-22T05:58:51         Author:user101289

Json Formatter

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?

Author:user101289,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38515049/bootstrap-and-jquery-modal-failing
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
yy