skip to Main Content

I have importaed javascript into my layout template:

<link href="//"> 

I have the following bootstrap modal triggered by a button

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      <div class="modal-body">
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>

Did I forget to do something here? I have never done a bootstrap modal before but this should open a modal upon hitting the button correct? I thought it was because perhaps I was missing bootstrap javascript but I imported it from cloudflare min file and still doesn’t do anything. What I am missing?



  1. You need to use a script tag for the bootstrap JS cdn not a link tag like so:

    <script type="text/javascript" src=""></script>

    Also make sure you are using jQuery

    Login or Signup to reply.
  2. Bootstrap JavaScript is written in a script tag, not a link one. The link one is for CSS.


    <link href="//">

    It should be:

    <script src="//"></script>

    You also need to include jQuery like this

    <script src=''></script>

    Otherwise your code is just fine!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top