E
E
error4012019-05-15 17:59:37
JavaScript
error401, 2019-05-15 17:59:37

When adding a menu, a dropdown menu item in Bootstrap 4, jquery errors appeared. How to fix?

I am building a website, at first there was an HTML template, now in the process of stretching it on WP. During the stretch on the CMS, an intermediate task appeared from the customer, to make one of the menu items drop-down. I started doing everything as usual, in the navbar menu I added one drop-down menu item. After that, an error related to jquery appeared in the console. In fact, everything works as intended, there are no problems. But the red console haunts. I can't figure out what's wrong. Error text in spoiler:

spoiler
jquery-3.4.1.min.js?ver=5.1.1:2 Uncaught Error: Syntax error, unrecognized expression: #
at Function.se.error (jquery-3.4.1.min.js?ver=5.1.1:2)
at se.tokenize (jquery-3.4.1.min.js?ver=5.1.1:2)
at se.select (jquery-3.4.1.min.js?ver=5.1.1:2)
at Function.se [as find] (jquery-3.4.1.min.js?ver=5.1.1:2)
at k.fn.init.find (jquery-3.4.1.min.js?ver=5.1.1:2)
at new k.fn.init (jquery-3.4.1.min.js?ver=5.1.1:2)
at k (jquery-3.4.1.min.js?ver=5.1.1:2)
at HTMLAnchorElement. (lowdown.js?ver=5.1.1:5)
at HTMLDivElement.dispatch (jquery-3.4.1.min.js?ver=5.1.1:2)
at HTMLDivElement.v.handle (jquery-3.4.1.min.js?ver=5.1.1:2)
se.error @ jquery-3.4.1.min.js?ver=5.1.1:2
se.tokenize @ jquery-3.4.1.min.js?ver=5.1.1:2
se.select @ jquery-3.4.1.min.js?ver=5.1.1:2
se @ jquery-3.4.1.min.js?ver=5.1.1:2
find @ jquery-3.4.1.min.js?ver=5.1.1:2
k.fn.init @ jquery-3.4.1.min.js?ver=5.1.1:2
k @ jquery-3.4.1.min.js?ver=5.1.1:2
(anonymous) @ lowdown.js?ver=5.1.1:5
dispatch @ jquery-3.4.1.min.js?ver=5.1.1:2
v.handle @ jquery-3.4.1.min.js?ver=5.1.1:2


After the problem appeared, I updated jquery and bootstrap to the latest versions, they were the penultimate ones. Did not help.

Menu code:

<nav class="navbar navbar-expand-lg navbar-dark justify-content-center"> 
          <a class="navbar-brand" href="<?php echo home_url(); ?>"><img src="<?php bloginfo('template_url') ?>/img/logotype.png" class="img-fluid"></a> 
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar1" aria-controls="navbar1" aria-expanded="false" aria-label="Toggle navigation"> 
          <span class="navbar-toggler-icon"></span> 
          </button> 


           <div class="collapse navbar-collapse" id="navbar1">

            <ul class="navbar-nav ml-auto"> 
              <li class="nav-item active"> 
                <a class="nav-link" href="#">Advantages<span class="sr-only">(current)</span></a> 
              </li> 
              <li class="nav-item dropdown">
                		<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
                		<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
                  			<a class="dropdown-item" href="#">Action</a>
                  			<a class="dropdown-item" href="#">Another action</a>
                  			<div class="dropdown-divider"></div>
                  			<a class="dropdown-item" href="#">Something else here</a>
                		</div>
      						</li>
              <li class="nav-item"> 
                <a class="nav-link" href="#">Promo materials</a> 
              </li> 
              <li class="nav-item"> 
                <a class="nav-link" href="#">Ways to attract</a> 
              </li> 
              <li class="nav-item"> 
                <a class="nav-link" href="#">Contacts</a> 
              </li>
              <li class="nav-item"> 
                <a class="nav-link log-a" href="#"><i class="fas fa-sign-in-alt"></i> Log in </a> 
              </li>
              <li class="nav-item"> 
                <a class="nav-link reg-a" href="#"><i class="fas fa-user-plus"></i> Register </a> 
              </li> 
            </ul> 

          </div>

        </nav>


I connected all the scripts through functions.php, it seems like in the right order. functions.php code:

<?php

/*Подключение скриптов и стилей*/

function style_script() {

  wp_enqueue_style( 'bootstrap.min.css', get_template_directory_uri() . '/css/bootstrap.min.css');
  wp_enqueue_style( 'style', get_template_directory_uri() . '/style.css');
  wp_enqueue_style( 'animate.min', get_template_directory_uri() . '/css/animatecss/animate.min.css');
  wp_enqueue_script( 'jquery-3.4.1.min', get_template_directory_uri() . '/js/jquery-3.4.1.min.js');
  wp_enqueue_script( 'bootstrap.min', get_template_directory_uri() . '/js/bootstrap.min.js');
  wp_enqueue_script( 'lowdown', get_template_directory_uri() . '/js/lowdown.js');
  wp_enqueue_script( 'wow.min', get_template_directory_uri() . '/js/wow.min.js');
  
}

add_action('wp_enqueue_scripts', 'style_script');

/*Header-menu*/

register_nav_menu('menu', 'Header Menu');


Tell me what could be the problem? where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aslan Galaev, 2019-05-15
@symbyozis

https://ru.stackoverflow.com/questions/517598/%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question