Problems with updated jquery

Asked

Viewed 889 times

0

Good morning I’m starting a site and I put the bootstrap - I put the most updated jquery that has that in the case is 3.1.1

No inspecte de element it presents me an error... I went to visualize and the merge is like this : Uncaught Error: Bootstrap’s Javascript requires jQuery summing up is to have the necessary jquery for bootstrap to work... only that this updated jquery was to work and I do not know why is giving this error

Detail my menu that has on the site is not working when I visualize in the mobile emulator that has in element inspecte of Chrome and other browser

It seems you’re not getting plugins needed for mobile. Can anyone help me?

Code:

 <head>
        <meta charset="utf-8">
        <meta name="description" content="Studio 7 Hair é um salão de beleza">
        <meta name="author" content="Miyomic">

        <title>Studio 7 Hair</title>

      <link rel="stylesheet" type="text/css" href="css/visual.css">

      <!-- responsivo -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

      <link href="css/bootstrap.min.css" rel="stylesheet">

      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

      <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
      <!-- Include all compiled plugins (below), or include individual files as needed -->
      <script src="js/bootstrap.min.js"></script>
      <script src="js/jqueryAtualizado.js"></script>
      <script src="js/jqueryAtualizado.min.js"></script>
      <script src="js/jquery-3.1.1.slim.min.js"></script>
      <script src="js/modernizr-2.6.2.min.js"></script>
      <script src="js/jquery-1.11.0.min.js"></script>
      <script src="js/jquery.nav.js"></script>
      <script src="js/jquery.parallax-1.1.3.js"></script>
      <!-- Fim responsivo -->

      <script src="js/digitar-home.js"></script>


    </head>
  • 1

    You imported jQuery before Bootstrap?

  • Post code where you import scripts but almost 99% sure that’s what @Lucascosta said ;)

  • is calling bootstrap first and then calling jquery

  • Inverts the order that should work @Nathan. Puts jQuery first after Bootstrap.

  • You are calling bootstrap and jquery several times, some reason in particular?

  • Error fixed... @Lucascosta thanks

  • and @leofontes not necessarily the script called with the url has already been taken

Show 2 more comments

1 answer

2


jQuery must be imported before Bootstrap, this may be an error cause in your case. As @leofontes mentioned, apparently you are importing more than once jQuery - this is not good practice. Your head should look more or less like this:

      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
      <script src="js/modernizr-2.6.2.min.js"></script>
      <script src="js/jquery.nav.js"></script>
      <script src="js/jquery.parallax-1.1.3.js"></script>

Include this in your head to work the menu for mobile:

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

Without them, World War III can start at any time.

  • Friend and why when I will view the site in Chrome’s mobile emulator it does not give me the menu as it should appear and something of the right script? because when I decrease the screen it shows the menu.. already in the emulator not

  • Apparently some meta tags are missing in your head, I updated the answer.

  • Thanks... but what would be these tags, is the bootstrap?

  • It’s actually from HTML5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.