Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Chrome shows following error in its console.

Uncaught Error: Bootstrap's JavaScript requires jQuery
at bootstrap.min.js:6


The navbar doesn't resize when using Google-Chrome's Toggle Device Toolbar. However, the same works fine in Firefox.
CSS
.navbar {
  margin-bottom: 0;
  background-color: #0E293C;
  z-index: 99;
  border: 0;
  font-size: 14px !important;
  line-height: 1.42857143 !important;
  letter-spacing: 4px;
  border-radius: 0;
  font-family: 'Muli', sans-serif;
}

.navbar li a,
.navbar .navbar-brand {
  color: #19BBD5 !important;
}

.navbar-nav li a:hover,
.navbar-nav li.active a {
  color: #C6DAEC !important;
  background-color: #0E293C !important;
}

.navbar-default .navbar-toggle {
  border-color: transparent;
  color: #fff !important;
}


HTML
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
      <a class="navbar-brand" href="#">Company Name</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#updates">Updates</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#how">How to use</a></li>
        <li><a href="#pricing">Pricing</a></li>
        <li><a href="#contact">Contact</a></li>
        <li><a href="#googleMap">Find Us</a></li>
      </ul>
    </div>
  </div>
</nav>


What I have tried:

I found a similar question where the problem was solved by making sure the .js files are getting loaded properly. But in my case this doesn't work. I made sure that jQuery.js is loaded first by putting it at the top of all the bootstrap resources. The website has been written by following this tutorial.
Posted
Updated 31-May-17 17:56pm
v2
Comments
Richard Deeming 31-May-17 16:08pm    
The error message is perfectly clear - either bootstrap.min.js is being loaded before jQuery, or jQuery is not being loaded at all.

You haven't shown us any of the <script> tags in your markup, so we can't tell you which problem is more likely.

Right-click on the page and choose "View page source". Verify that the jQuery <script> tag appears before the Bootstrap <script> tag. If it does, click on the link in the src attribute and verify that it loads the correct script.
theRealGreenz1 31-May-17 23:51pm    
Thanks for reply. The issue has been solved. Please see answer for further details

1 solution

An
iframe
element was going out of the bootstrap columns.

Adding following css helped resolve the issue

CSS
html, body {
    width: 100%;
    overflow-x: hidden;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900