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!
-
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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login