error Uncaught SyntaxError: missing) after argument list

1

I'm trying to put a menu in my blog, which is not working # ... And I think this can happen due to this error in the javascript (but as I'm not sure if what it is causing the problem is the error, I separated the question so as not to get confused) :

  

Uncaught SyntaxError: missing) after argument list

This is javascript

<script>
(function($) {
  $.fn.menumaker = function(options) {
    var cssmenu = $(this),
      settings = $.extend({
        format: "dropdown",
        sticky: false
      }, options);
    return this.each(function() {
      $(this).find(".button").on('click', function() {
        $(this).toggleClass('menu-opened');
        var mainmenu = $(this).next('ul');
        if (mainmenu.hasClass('open')) {
          mainmenu.slideToggle().removeClass('open');
        } else {
          mainmenu.slideToggle().addClass('open');
          if (settings.format === "dropdown") {
            mainmenu.find('ul').show();
          }
        }
      });
      cssmenu.find('li ul').parent().addClass('has-sub');
      multiTg = function() {
        cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
        cssmenu.find('.submenu-button').on('click', function() {
          $(this).toggleClass('submenu-opened');
          if ($(this).siblings('ul').hasClass('open')) {
            $(this).siblings('ul').removeClass('open').slideToggle();
          } else {
            $(this).siblings('ul').addClass('open').slideToggle();
          }
        });
      };
      if (settings.format === 'multitoggle') multiTg();
      else cssmenu.addClass('dropdown');
      if (settings.sticky === true) cssmenu.css('position', 'fixed');
      resizeFix = function() {
        var mediasize = 700;
        if ($(window).width() > mediasize) {
          cssmenu.find('ul').show();
        }
        if ($(window).width() &lt;= mediasize) {
          cssmenu.find('ul').hide().removeClass('open');
        }
      };
      resizeFix();
      return $(window).on('resize', resizeFix);
    });
  };
})(jQuery);

(function($) {
  $(document).ready(function() {
    $("#cssmenu").menumaker({
      format: "multitoggle"
    });
  });
})(jQuery);

</script>

And here's the part of the error-related code:

cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');

I researched this error, but the answers were very unique to each code ... It's hard to look at a code and find out what the problem is.

blogs with menu / error: link link

  

Note: Is there an error site where you have listed several errors and their   causes It would be very good by the way.

    
asked by anonymous 24.04.2016 / 13:00

1 answer

3

It is because of this excerpt in the resizeFix function where you have &lt;= in the code:

if ($(window).width() &lt;= mediasize) {
   cssmenu.find('ul').hide().removeClass('open');
}

The correct one would be:

if ($(window).width() <= mediasize) {
   cssmenu.find('ul').hide().removeClass('open');
}
    
24.04.2016 / 13:30