[Resolved] Conflict between WPML and custom JavaScript menu script
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
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?