WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress
[resolved] global.js bad syntax lines 812 and 822 (5 posts)

  1. jeremiahbrock
    Member
    Posted 1 year ago #

    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/

  2. Boone Gorges
    Moderator
    Plugin Author

    Posted 1 year ago #

    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.

  3. jeremiahbrock
    Member
    Posted 1 year ago #

    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.

  4. jeremiahbrock
    Member
    Posted 1 year ago #

    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.

  5. jeremiahbrock
    Member
    Posted 1 year ago #

    [Marking this resolved]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic