Uncaught TypeError: $(…).modal is not a function

I want to show a modal in my website on page load. But I got this error

Uncaught TypeError: $(…).modal is not a function

I have also tried with jQuery but also get the same type of error

Uncaught TypeError: jQuery(…).modal is not a function

I have googling already several times and apply different solutions but not succeeded.

Here is my script

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
   $(window).on('load',function(){
      $('#loadModal').modal('show');
   });
</script>

Here is my modal

<div class="modal hide fade" id="loadModal">
    <div class="modal-header">
         <a class="close" data-dismiss="modal">×</a>
         <h3>Modal header</h3>
    </div>
    <div class="modal-body">
         <p>One fine body…</p>
    </div>
    <div class="modal-footer">
         <a href="#" class="btn">Close</a>
         <a href="#" class="btn btn-primary">Save changes</a>
    </div>
</div>

107 thoughts on “Uncaught TypeError: $(…).modal is not a function”

  1. First off I want to say superb blog! I had a quick question that I’d like to ask if you do not mind.
    I was interested to find out how you center yourself and clear your thoughts prior to writing.

    I’ve had a difficult time clearing my mind in getting my thoughts
    out there. I truly do enjoy writing however it just
    seems like the first 10 to 15 minutes tend to be lost simply just
    trying to figure out how to begin. Any suggestions or
    hints? Thanks! http://antiibioticsland.com/Stromectol.htm

    Reply
  2. Uncaught TypeError: $(…).modal is not a function – JavaScript Help kamagra sildenafil citrate [url=http://kamagrapolo.com]potencia[/url] kamagra oral jelly at walgreens

    Reply
  3. Hi there, I found your site via Google even as looking for a similar matter, your web site got here up, it
    appears to be like great. I have bookmarked it in my google bookmarks.

    Hello there, simply was alert to your blog via Google, and found
    that it is really informative. I’m going to be careful
    for brussels. I’ll appreciate if you continue this in future.
    Numerous folks will be benefited from your writing.
    Cheers! http://ciaalis2u.com/

    Reply

Leave a Comment