Title: JS code problem. Error jQuery
Last modified: January 22, 2021

---

# JS code problem. Error jQuery

 *  [rphdigital](https://wordpress.org/support/users/rphdigital/)
 * (@rphdigital)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/)
 * 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, 4 months ago by [bcworkz](https://wordpress.org/support/users/bcworkz/).

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

 *  [cloudmatrics](https://wordpress.org/support/users/cloudmatrics/)
 * (@cloudmatrics)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/#post-13943069)
 * 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](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/#post-13945316)
 * 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](https://wordpress.org/support/users/scapolupogmailcom/)
 * (@scapolupogmailcom)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/#post-13950856)
 * 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](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/#post-13955105)
 * In _some_ cases trouble with script errors can be resolved with this plugin:
   
   [https://wordpress.org/plugins/enable-jquery-migrate-helper/](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.

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [js](https://wordpress.org/support/topic-tag/js/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 4 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/js-code-problem-error-jquery/#post-13955105)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
