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
- ValueError:All arrays must be of the same length - Python
- Check hostname requires server hostname - SOLVED
- How to restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
- FieldError: Cannot resolve keyword 'id' into field in Django project
Related Article