I created a bootstrap model popup when I tried to open it via jQuery, I got this following error “Uncaught TypeError: f[b] is not a function” and a bootstrap model popup is not opening.
Code:
<script type="text/javascript">
$(function () {
$("#btnShow").click(function () {
$('#demoModal').modal('open');
});
});
</script>
<div style="text-align: center; margin-top: 10%">
<button id="btnShow" class="btn btn-primary btn-lg">Show Modal Popup</button>
</div>
<!--Modal -->
<div class="modal fade" id="demoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Bootstrap Modal Popup</h4>
</div>
<div class="modal-body">content goes here..</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btnbtn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Solution:
Previously, I used the wrong syntax to open a bootstrap model popup, next I correct it and open jQuery bootstrap popup like this, $('#demoModal').modal('Show');.
Post your comments / questions
Recent Article
- How to add two numbers in Android Studio? | Source Code
- FindViewByID returns null in android studio -SOLVED
- Saving changes is not permitted in SQL SERVER - [SOLVED]
- Restore of database failed. File cannot be restored over the existing. -[SOLVED]
- One or more projects in the solution were not loaded correctly in Visual Studio 2019 | FIXED
- How to find Laptop's Battery Health?
- SOLVED-Related Field got invalid lookup: icontains error in Django
- How to enable Search Feature in Django admin?
Related Article