When using bootstrap modal box, uncaught typeerror: $(…). Modal is not a function
Look at the official website code, found no error, and video source comparison also found no error
//Click the add button to pop up the add page
$("#emp_add_modal_btn").click(function(){
//clear form data
//send ajax request to query department information and display it in the list
// pop up the add page
$("#empAddModal").modal({
backdrop:false
});
});
It turns out that the introduction of jQuery is behind the bootstrap. Just put the JS introduction of jQuery behind the bootstrap
<script type="text/javascript" src="${APP_PATH}/static/js/jquery-1.12.4.min.js"></script>
<link href="${APP_PATH}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="${APP_PATH}/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
Similar Posts:
- Uncaught Error: Bootstrap’s JavaScript requires jQuery at bootstrap.min.js:6
- bootstrap.min.js:6 Uncaught Error: Bootstrap’s JavaScript requires jQuery at bootstrap.min.js:6
- [jQuery version] cannot read property ‘MSIE’ of undefined solution
- Error in JS function referencing public page [How to Solve]
- How to Copy Echarts Map Examples to Local vueCLI Project (Commissioning Operation)
- JQuery Error: TypeError: jQuery.curCSS is not a function [How to Solve]
- [Solved] Vue cli 3.0 error: “Failed to load resource: net::ERR_FILE_NOT_FOUND”
- Error: Can’t walk dependency graph: Cannot find module ‘@popperjs/core’ from ‘node_modules\bootstrap\dist\js\bootstrap.esm.js’
- [Solved] Uncaught syntax error: invalid regular expression flags
- Always report uncaught error:[$ injector:modulerr ]Solutions to errors