New search feature javascript error
-
Hi Armin,
Love the look of the new search.
However for some reason I can't get the search to work on a site.
Looking into the console, I'm getting the following:
Uncaught TypeError: Cannot read property 'search' of undefined on line 4152
in ...themes/lay/frontend/assets/js/frontend.app.min.js?ver=2.6.9 -
Hi its me again,
OK - I believe I found the issue in my case. Is it possible to add the site url as the root of site when making the AJAX request to the wp-jason search? My install is in a sub-folder at the moment so that we could test the new search without breaking the live site and the AJAX request is made to the root of the domain
I'm assuming site-url is not used based on the following error but I could be wrong:
Access to XMLHttpRequest at 'https://whiteoctopuswebdev.com/wp-json/laytheme/search/' (redirected from 'http://whiteoctopuswebdev.com/wp-json/laytheme/search/') from origin 'http://whiteoctopuswebdev.com' has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response.
Thanks!
-
Dear @plpepin
just to completely understand you:
On the website which you installed in a subfolder you want to show the Search-Results from the main-folder website?Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it