Title: How to debug Javascript to check a specific behavior
Last modified: August 27, 2021

---

# How to debug Javascript to check a specific behavior

 *  [londonuk371](https://wordpress.org/support/users/londonuk371/)
 * (@londonuk371)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/)
 * Hello,
 * I need to debug Javascript to check which function is called on a specific behavior.
 * To be more specific, when we click inside an iframe, all the page or at least
   the iframe is reloaded, so loaded 2 times.
 * For example, if you take a look on the page given with this post and click on
   the artist “Klimt”, the main page activate a javascript function, display an “
   Loading” image on the entire page and reload the iframe content.
 * I tried with the Chrome Devtools but can’t figure out which function is called
   display the image “Loading…” and reload the iframe.
 * It’s reloaded maybe because the url is dynamically updated with javascript. The
   anchor #collection/hopper/ will become #collection/klimt/.
 * This strange behavior appeared after an wordpress upgrade.
 * Thank you for your help,
    Vincent.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-to-debug-javascript-to-check-a-specific-behavior%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/#post-14811438)
 * There seem to be several JS errors (visible in the console) that you want to 
   resolve before anything else. I refer to the “red” errors visible in the console.
 * Something related to (probably) Facebook Pixel Script is on top of all other 
   errors, referring to a script loaded somewhere in the middle of the HTML page(
   which is likely not how it should be done, this scripts usually go in the header
   or footer section).
 * It uses `require()`, which is not part of JS, and thus needs some external scripts
   to work properly. Those scripts are likely not loaded, and thus throw the error.
   That can then send the entire subsequent page/code into failure.
 * I would suggest figuring out why the FB Code is in the middle of the page, if
   it requires some additional enqueued scripts, if perhaps some plugin is adding
   it (you can find out by disabling plugins bulk wise and re-enabling until you
   found the culprit), or if a theme adds it. Then enter in contact with said theme
   or plugin, in case you can’t find the exact cause for failure.
 * I suggest doing all this on testing sites, so you do not need to do this on the
   production website.
 *  Thread Starter [londonuk371](https://wordpress.org/support/users/londonuk371/)
 * (@londonuk371)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/#post-14812430)
 * Thank you @bedas for your reply.
 * Yes there are Javascripts errors which are on all the pages.
 * What I would like to know is which plugin activate the “Chargement en cours” (
   Loadin in progress) notification between each pages of the iframe.
 * I would like to desactivate it.
 *  Thread Starter [londonuk371](https://wordpress.org/support/users/londonuk371/)
 * (@londonuk371)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/#post-14812596)
 * To show you another example: Here is the same gallery inserted into another WordPress
   website:
    [Gallery](https://bit.ly/3BkgclS) And: 1/ The pages are not loaded 
   2 times. 2/ We can access to the basket (Mon panier) which is not possible on
   the first website shown because it reloads the page 2 times.
    -  This reply was modified 4 years, 8 months ago by [londonuk371](https://wordpress.org/support/users/londonuk371/).
 *  Anonymous User 14808221
 * (@anonymized-14808221)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/#post-14813212)
 * Hi [@londonuk371](https://wordpress.org/support/users/londonuk371/)
 * > What I would like to know is which plugin activate the “Chargement en cours”(
   > Loadin in progress) notification between each pages of the iframe.
   > I would like to desactivate it.
 * The easiest and fastest to find out is disabling plugins, and re-enabling them
   one by one. Check each time the front end and as soon the feature comes back 
   you know which plugin enables that feature.
 * I suggest doing this in a staging environment.

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

The topic ‘How to debug Javascript to check a specific behavior’ is closed to new
replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [reload page](https://wordpress.org/support/topic-tag/reload-page/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: Anonymous User 14808221
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/how-to-debug-javascript-to-check-a-specific-behavior/#post-14813212)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
