Hi,
I’m getting the following error when trying to use any functionality that relies on Ajax (like mega menus, live search box and prev-next buttons):
Uncaught SyntaxError: Unexpected token
They work absolutely fine on Firefox but seems like Chrome is a bit more picky.
Do you know where could it be coming from?
Here is a link to the test site:
http://www.ultimocero.com.gridhosted.co.uk/WORDPRESS/
And one of errors from the console:
Uncaught SyntaxError: Unexpected token <
m.parseJSON @ jquery.js:5
e.parseJSON @ jquery-migrate.min.js:2
td_ajax_search.process_ajax_response @ tagdiv_theme.js:198
tdLocalCache.exist.jQuery.ajax.success @ tagdiv_theme.js:200
j @ jquery.js:2
k.fireWith @ jquery.js:2
x @ jquery.js:5
b @ jquery.js:5
Many thanks in advance!
Hello Chucho,
Usually, these kinds of errors appear when you use untested plugins. Please try to disable all the active plugins, leave just Visual Composer to active, clear all cache and install only the plugins that come bundled with our theme and rule out the conflicting plugins. Most likely, your untested plugins interfere with our theme and could create js errors. Please try my advice and see if your problem is still there. After this, try to install your untested plugins one by one and find the culprit and then try to replace it with another one with this functionality (this is the alternative).
Hope this helps and let us know how it goes!
Thank you for the message!
Hi Catalin, thanks for your quick reply.
After a few hours testing the plugins I decided to make a copy of the website on a different subdirectory (changing the permalinks and other references to the URL in the database as usual).
Everything is working fine now, and although I’m not 100% sure about it, looks like what was causing the error was a file blocked by the lack of ‘Access-Control-Allow-Origin’ headers (somehow it was trying to load it from a different folder/subdomain, which was blocking that request).
Advice for other users? When moving WP from one place to another, make sure you change all the URLs in your database properly! 🙂
Hello Chucho,
Thank you for your suggestion. Usually, this kind of error appears when using CDN or loading fonts from a different source. Please try to use this solution and take a look at this: http://screencast.com/t/AMjW530CSH6 and this: http://screencast.com/t/dLjEUGGwQUZ
The solution to this issue is simple. You will need to add some code to your .htaccess file like this post suggests: https://forum.tagdiv.com/topic/strange-chinese-symbols-replaced-icons-and-arrows/
Hope this helps and let us know how it goes!
Thank you for the message!