Mobile menu not working - js error

Hello Team

The mobile menu on our site does not want to expand. I have the latest X theme and child theme version, deactivate all 3rd party plugins and removed css without any luck.

I get the following errors in the console (Chrome) when clicking on the mobile menu button:

jquery-1.12.4.js:2 Uncaught Error: Syntax error, unrecognized expression: ,
at Function.fa.error (jquery-1.12.4.js:2)
at fa.tokenize (jquery-1.12.4.js:2)
at fa.compile (jquery-1.12.4.js:2)
at fa.select (jquery-1.12.4.js:2)
at Function.fa (jquery-1.12.4.js:2)
at Function.a.find (jquery-migrate.min-1.4.1.js:2)
at HTMLBodyElement.handlers (jquery-1.12.4.js:3)
at HTMLBodyElement.dispatch (jquery-1.12.4.js:3)
at HTMLBodyElement.r.handle (jquery-1.12.4.js:3)

The site is runner.noble-pro.com

I have deactivated all CSS and js combiners.

Regards,
Stefan van Biljon

Hi Stefan,

Thanks for writing in! Also make sure to update your WordPress version, if you’re using an older version. You can see the latest version from here (https://wordpress.org/download/) and follow their update guide here (https://codex.wordpress.org/Upgrading_WordPress).

To troubleshoot your issue further, you also need to remove any custom JavaScript added to your site. For example any JavaScript added to your X -> Theme Options -> JS section or using any other method.

Further, it’s also important to clear all caches before testing your site. You can refer to the following resource on how to clear caches (https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/).

If you’re still having issues, please provide us with your WordPress login credentials in a secure note to check your issue further.

Thanks!

I have no JavaScript added to your X -> Theme Options -> JS section or using any other method I am aware of. We are on Wordpress 5.2 and php7+. This configuration is also running on our noble-pro.com site without any issues.

Please can you have a closer look from the backend as I am unable to figure out what is causing the issue.

Hello Stefan,

Thank you for the credentials.
I can see the issue. Did you just update to 5.2? It seems like a wordpress jQuery problem. Could you please setup another staging area with an exact copy of your live site.

You can follow our migration guide here (https://theme.co/apex/forum/t/cornerstone-content-builder-migration/126).

On this staging site, try to switch the theme and then see the result as the error seems not related to the theme. If the issue still exist, please try first to reinstall wordpres core on this staging site and then check again. Do let us know how this goes.

I have activated the Twenty Nineteen version 1.4 theme and the drop down menu does work in the mobile version for this theme. I have reinstalled Wordpress core as suggested.

The issue still persists. I have no real changes in the X Child theme either.

Please can you assist in resolving the issue.

Hi Stefan,

I couldn’t find what causing this issue, please provide your FTP login credentials as well asI like to use the versions I currently have as I can’t reproduce this on same versions that I have. Then I will continue checking.

Thanks!

I have provided the login details below.

Hi Stefan,

The cause of the issue is one of your plugin, I deactivated all plugins through FTP except for cornerstone and the mobile menu starts working.You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Or you can try disabling your plugin one at a time through FTP by renaming each folder, example /plugin_awesome/ can be renamed to /plugin_awesome_1/ to disable it. You can rename them back again once you find the culprit.

Let us know how it goes!

1 Like

Hey Team

I can confirm the issue is the Essential Grid plugin. The understanding is that this plugin is supported by yourselves?

What is the best way to address the issue?

Regards,
Stefan

Hi Stefan,

This is the cause of the issue,

jQuery('body').on('click', ', ', function(e) {

and it’s coming from Essential Grid, which I couldn’t reproduce on my installation. And this is skin related, the skin displayed on the admin is different on what’s displayed on front.

			jQuery('body').on('click', ', ', function(e) {
				
				if(jQuery('#esg_search_bg').length > 0) return true; //only allow one instance at a time
				
				var identifier = 0;
				var overlay_skin = ["light","light"];
				var skins = ["5","6"];
				
				if(jQuery(this).is('')){
				identifier = 0;
			}else if(jQuery(this).is('')){
				identifier = 1;
			}				

It’s probably corrupted, so I created a new grid and a test page, and it works there. Which means, your current grid is the culprit but not the entire Essential Grid plugin. Could you try creating the same grid again?

Thanks!

I have checked the menu function on the test page you created in incognito and it does not seems to be working either. I therefore get the same error no matter the skin used to display a grid on the page. The issue seems to website wide because the error persists on a page with no essential grid visual elements present e.g. about page.

Hello Stefan,

Even if the page does not have any grid, the script is still loaded on the page which affects the mobile menu.
Please have the Javascript code updated and use this:

jQuery('body').on('click touchstart', function(e) {
				
	if(jQuery('#esg_search_bg').length > 0) return true; //only allow one instance at a time
	
	var identifier = 0;
	var overlay_skin = ["light","light"];
	var skins = ["5","6"];
	
	if(jQuery(this).is('')){
	identifier = 0;
}else if(jQuery(this).is('')){
	identifier = 1;
}

Hope this helps. Please let us know how it goes.

Hello Team

I am having endless issues with Essential Grid and the support sucks as they take forever to respond and don’t seem to give a hoot to resolve your issue.

I have uninstalled and reinstalled the Essential Grid plugin as the as deleting the skins did not resolve anything. I am now sitting with an issue where Essential Grid does not want to activate the Purchase code.

Thank you for the help and I will work to resolve the issue with the plugin.

Hi Stefan,

We’re sorry you’re having this issue. Unfortunately, we cannot help you with Essential Grid purchase code issue. This should be discuss directly to the plugin developer. If you have any other things you need guidance though, we are here to help. Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.