Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Feedback
  3. New search feature javascript error

New search feature javascript error

Scheduled Pinned Locked Moved Feedback
4 Posts 2 Posters 332 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    plpepin
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      plpepin
      wrote on last edited by
      #2

      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!

      P 1 Reply Last reply
      0
      • P plpepin

        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!

        P Offline
        P Offline
        plpepin
        wrote on last edited by
        #3

        @plpepin I failed to mention that the site with the laytheme is in a sub directory of the main domain mentioned in the error above ( as in http://whiteoctopuswebdev.com/staging/my-install-with-laytheme

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          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

          www.mariusjopen.world

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          šŸ’æ Email me here: šŸ’æ
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. 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:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search