SuperFish broken with JQuery 1.9+

Community Forums Forums General Discussion SuperFish broken with JQuery 1.9+

This topic is: not resolved

This topic contains 4 replies, has 4 voices, and was last updated by  JM_Cook 1 year, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12587

    jstuartj
    Participant
    Post count: 15

    Just in case some of you run into the same problem,  I just updated  a plug-in that was en-queuing  jQuery 1.9.0,  which no-longer supports $.broswer therefore  breaking  Superfish.js.   [It's looking for:  $.brower.msie ]

    The quick solution is to  add the query-migrate-1.0.0.min.js  plug-in which enables legacy browser sniffing. Hopefully superfish will be updated or replaced before WordPress updated its included version of jQuery.

    jQuery Core 1.9 Upgrade Guide
    jQuery.browser() removed
    The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.

    I added a js folder dropped the jQuery migrate plug into it and add the following to my function file.

    /** Add JQuery Migrate to Genesis child theme */

    add_action(‘wp_enqueue_scripts’, ‘bugfix_add_jquery_migrate’);
    function bugfix_add_jquery_migrate(){
    if (!is_admin()) {
    wp_register_script( ‘jquery-migrate’, get_stylesheet_directory_uri() . ‘/js/jquery-migrate-1.0.0.min.js’, array(‘jquery’));
    wp_enqueue_script( ‘jquery-migrate’);
    }
    }

    • This topic was modified 1 year, 6 months ago by  jstuartj.
    • This topic was modified 1 year, 6 months ago by  jstuartj.
    #12646

    sheilab
    Participant
    Post count: 16

    Thanks so much for this.

    I added the js folder with the query-migrate-1.0.0.min.js file at the same level as  function.php in my theme and I am getting this parse error with the code I cut and pasted into my functions.php file. Please advise.
    Parse error: syntax error, unexpected T_DNUMBER in /home/bergman2/luvnbitsnparts.com/wp-content/themes/venture/functions.php on line 32

    /** Add JQuery Migrate to Genesis child theme */

    add_action(‘wp_enqueue_scripts’, ‘bugfix_add_jquery_migrate’);
    function bugfix_add_jquery_migrate(){
    if (!is_admin()) {
    wp_register_script( ‘jquery-migrate’, get_stylesheet_directory_uri() . ‘/js/jquery-migrate-1.0.0.min.js’, array(‘jquery’));
    wp_enqueue_script( ‘jquery-migrate’);
    }
    }

    #12759

    jstuartj
    Participant
    Post count: 15

    Looks like something is changing single quotes to curly quote when I copy and pasted to the form… to my editor, you might check that, it happened in WeBuilder 2014 but note Notepad++. Let me try again in code tags maybe that will help.

    Is there a way to edit posts? I would like to fix the above but I’m not finding away.

    [php]add_action(‘wp_enqueue_scripts’, ‘bugfix_add_jquery_migrate’);
    function bugfix_add_jquery_migrate() {
    if (!is_admin()) {
    wp_register_script( ‘jquery-migrate’, get_stylesheet_directory_uri() . ‘/js/jquery-migrate-1.0.0.min.js’,array(‘jquery’));
    wp_enqueue_script( ‘jquery-migrate’);
    }
    }
    [/php]

    #17002

    kylehufford
    Participant
    Post count: 3

    My site http://www.vanburenpubliclibrary.org should have the fancy drop downs and I have tried your fix with no luck. I just started on this site yesterday so it’s not a situation where the drop downs ever worked. Thanks.

    #38874

    JM_Cook
    Participant
    Post count: 4

    Are there any plans to update the version of Superfish which is included with Genesis or does that create other problems?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.