c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
JQuery

JQuery error: Uncaught TypeError: f[b] is not a function

| | JQuery

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. 

Uncaught TypeError: f[b] is not a function

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">&times;</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');.