• Hello.

    I have a problem. I am using a little custom code in JS and since the last update it has stopped working. I think it is due to jQuery migrate but I don’t know how I can fix it. I have this code inserted in the JS section that has the theme itself enabled to introduce custom code. I would appreciate if someone can help me by writing down an answer. How can I solve this problem? What can I do to make everything work correctly again? Thanks everyone in advance.

    The current code I use is the following:

    jQuery(document).on('click', 'div.customclass', function (event) {
    event.preventDefault();
    jQuery('.registrogratis').slideToggle();
    });
    • This topic was modified 5 years, 1 month ago by bcworkz.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    check out if any jquery CDN required to add, as there was a migration. So if anyone works it would be great.

    Moderator bcworkz

    (@bcworkz)

    Your browser’s console should be listing any errors that are encountered. The error message will indicate what the problem is and would be a clue to how to fix it.

    Salvatore

    (@scapolupogmailcom)

    Same problem here, tried some retro-versions with no success. In a single case new jQuery does not allow to work WordPress in all interactive / JS part, either back and front-end.

    A little workaround should be putting this in the wp-config.php:

    
    define( 'CONCATENATE_SCRIPTS', false ); 
    define( 'SCRIPT_DEBUG', true );

    jQuery loaded is 3.5.1, but not working as usual until today.
    Any other help would be great.

    Moderator bcworkz

    (@bcworkz)

    In some cases trouble with script errors can be resolved with this plugin:
    https://wordpress.org/plugins/enable-jquery-migrate-helper/

    This is not a permanent solution, more of a patch to get things working until the underlying issue can be addressed.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘JS code problem. Error jQuery’ is closed to new replies.