• There appears to be a problem with the query-monitor.js script, in that assumes the “query-monitor-main” block has been loaded. If you move the line “window.addEventListener(‘load’, function() {” to before the test for whether jQuery has been defined, (line 48) then everything works OK.

    I found that the code to initialise container was being run before the element “query-monitor-main” was defined. The result is that whilst you can see the Query Monitor on the page, you are unable to interact with the facility.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks for the report. This change doesn’t really make sense so I think it might be a red herring.

    • Which theme are you using?
    • Does the problem still exist if you switch to one of the default themes such as Twenty Twenty One?
    • Do you have any plugins active that disable jQuery or load it from elsewhere?
    • Do you have any plugins active that change the order that JavaScript or CSS files are loaded or try to “optimise” or disable them?
    Thread Starter DaveWP196

    (@davewp196)

    1. It is my custom theme. I do use a number of jQuery libraries (including accordion, contextMenu, UI, slickgrid).
    2. I have checked at original logic does work with the Twenty Twenty One Theme.
    3. Placing a breakpoint on line 56 and looking at the DOM environment, I can see that the query-monitor-main block has not been loaded, but it is loaded when the window.load event is triggered. As the Query Monitor HTML code is served after the </html> statement, I’m not sure of the logic used to move the block into the DOM either at bottom of the page or into the dashboard area at the top of the screen. Is this a CSS defined movement?
    4. This said, the change I have proposed does ensure the code on lines 51 and after line 56 does not run until the page has finished loading into the DOM and any associated CSS changes have completed.

    BTW – I’m using Bing on windows 11

    • This reply was modified 2 years, 1 month ago by DaveWP196.
    • This reply was modified 2 years, 1 month ago by DaveWP196.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not Working – scripting issue’ is closed to new replies.