Support » Plugins and Hacks » BuddyPress » global.js bad syntax lines 812 and 822

  • Resolved jeremiahbrock

    (@jeremiahbrock)


    The global.js has bad syntax calling a non existent function .on which is referenced on lines 812 and 822 of BuddyPress 1.6.1

    Broken Code

    jq('.visibility-toggle-link').on( 'click', function() {
                    var toggle_div = jq(this).parent();
    
                    jq(toggle_div).fadeOut( 600, function(){
                            jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
                    });
    
                    return false;
            } );
    
            jq('.field-visibility-settings-close').on( 'click', function() {
                    var settings_div = jq(this).parent();
    
                    jq(settings_div).slideUp( 400, function(){
                            jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
                    });
    
                    return false;
            } );

    Modified Working

    jq('.field-visibility-settings').hide();
            jq('.visibility-toggle-link').click( function() {
                    var toggle_div = jq(this).parent();
    
                    jq(toggle_div).fadeOut( 600, function(){
                            jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
                    });
    
                    return false;
            } );
    
            jq('.field-visibility-settings-close').click( function() {
                    var settings_div = jq(this).parent();
    
                    jq(settings_div).slideUp( 400, function(){
                            jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
                    });
    
                    return false;
            } );

    http://wordpress.org/extend/plugins/buddypress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Boone Gorges

    (@boonebgorges)


    If you’re seeing an error with the use of on(), it means that you’re using an out-of-date version of jQuery. My guess is that you have another plugin or a theme that is deregistering the version of jQuery that comes with WP, and registering an older one in its place. This is very bad practice. Try deactivating your plugins one by one to see which of them is the culprit.

    Thx Boone, I did try that and determined it was the BuddyPress 1.6.1 plugin as I had deactivated all other plugins and still received the error :

    Timestamp: 11/2/2012 4:21:31 PM
    Error: TypeError: jq(".visibility-toggle-link").on is not a function
    Source File: http://207.145.224.38/wp-content/plugins/buddypress//bp-themes/bp-default/_inc/global.js?ver=3.4.2
    Line: 812

    Hope you have a great weekend.

    Hi Boone,

    Firebug is showing the following after entering jQuery.fn.jquery into the console : “1.6.2”

    I see that 1.7 is when .on() was added to jQuery. I believe that the Theme I am using is the culprit.

    Thx for pointing me in the right direction.

    [Marking this resolved]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘global.js bad syntax lines 812 and 822’ is closed to new replies.