[ad_1]
Hi!
I have a somewhat convoluted issue, but I’ll try to describe it as good as I can. I’m using WordPress 6.1 with a child of Twenty Twenty-Three. This is all local at the moment so I can’t give an URL.
The short version of the issue is that I’ve added javascript to the HTML block, but it’s not working and I’m getting the error Uncaught ReferenceError: jQuery is not defined.
I tried various ways of loading the javascript, like using Code Snippets plugin, but it’s the same error. I also tried the method described here but it’s like the script doesn’t exist at all then.
The long version of the issue is I’m creating my site with FSE and block-editor Gutenberg now. Before I used Elementor. In Elementor I had created a hamburger menu button with an off screen menu that would become visible or unvisible as you clicked the button. To achieve this I used Elementor’s HTML widget and added some HTML as well as the javascript, and then some CSS for the styles of the button and the off screen menu. The off screen menu itself was a container with display: none property which changes to display: block upon opening the menu.
I’m trying to achieve the same, but the javascript is not working. For recreating the off screen menu itself I used the Group block with a custom css class and it does ‘hide’ as it should, but the javascript for making it appear doesn’t work. Might be worth to mention that the error Uncaught ReferenceError: jQuery is not defined is there already before trying to press the button.
Thank you in advance
