Background of the issue:
I’m trying to use WPML CMS on my site, hidden link, but when I activate the WPML CMS plugin, my submenus stop working, and I see errors in the browser console when I press F12. These issues do not occur when WPML CMS is deactivated. I have attempted to troubleshoot the issue by delaying the script execution using jQuery(window).on('load', ...) and by using the wpml_loaded hook, but the issue persists.
Symptoms:
Uncaught ReferenceError: index is not defined at menu-overflow.js:10:1268 at HTMLUListElement. (menu-overflow.js:10:1278) at Function.each (jquery.min.js?ver=3.7.1:2:3129) at e..each (jquery.min.js?ver=3.7.1:2:1594) at $.fn.swMenu (menu-overflow.js:10:40) at menu-overflow.js:12:31 at menu-overflow.js:15:3
Questions:
How can I resolve the conflict between WPML CMS and my custom JavaScript menu script?
Is there a specific way to load scripts when using WPML to avoid such conflicts?