Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search not working properly since WP updated to 4.5 › Reply To: Search not working properly since WP updated to 4.5
Hi!
I think I have found why fails to work, but the source of the problem is probably related to a theme javascript file. Let me explain.
The search has an event listener function bound to the window “scroll” event. This function does some calculations mostly. A similar function is bound to a window resize event, so it’s redundant. Either fails, the other one corrects.
After loading these event listeners, the plugin triggers the “scroll” and the “resize” events when initializing itself to perform the caltulations. Of course nothing stops other jquery plugins to bind other functions to these events, so when triggering the “scroll” event, other event listener functions are executed as well – which is no problem at all, this is how it supposed to work. However if there is an error in any of the executed event listener functions the execution terminates. This is exactly what happens.
Basically as far as I was able to dig through the stack – the theme.js somewhere binds an event listener to the window scroll event. This function however has an error and triggers an error message. Ajax search pro also bounds it’s function to the “scroll” event listener and triggers it when initializing – causing the error coming from the other function to terminate the execution. It’s a rather complicated issue.
As a temporary solution I have disabled the srcoll trigger within the ajax search pro non-minified javascript file so the execution is not terminated immediately now. However the error coming from the theme.js is still there, and it’s thrown anytime you sroll the page.
I cannot pinpoint the exact line in that file as it’s unfortunately minified 🙁
Check this video of the issue (unlisted): https://youtu.be/d6vbx8749ao
I’ve turned off the javascript merge and minification on the cache plugin. I suggest not turning it on until this is resolved.