Since version 0.5 the scripts alre loaded intelligently… Meaning they only get added to a page when there is actually a search going on. So visitors (and you) that are just browsing your pages will not be slowed down by any jQuery scripts loading in the background and checking for empty strings and then doing nothing 🙂
So do a search via the Search form on your site and check the source again. The script should be there.
If not, let me know…
In my theme, I use AJAX to perform searches. Is there anyway to implement it since the page isn’t reloaded?
Ok, I see… I do not know if loading the script by default would even work in the case of ajax searches. It needs a page (re)load to set the search terms as variables so I suspect it won’t do you any good.
However, it will do it’s job when a visitor enters you page via a search on Google/Bing/etc. 😉
But since the plugin just loads a JavaScript, couldn’t I just implement it in my theme’s scripts? If so, how?
No, the plugin actually does TWO things. One is indeed loading the jQuery javascript but the other one is detecting which search terms where either used in the website search or in the Search Engine search and placing them in a string (or array) value to make them available for javascript to work with.
So you could easily make your theme append the javascript but by itself, that would not do anything. You need also the used search terms as a string value…
My plugin detects the used search terms via PHP but I can image it might also be possible (at least for a local search where the terms are used in the ?s=... behind the results page URI) to do this with javascript. Or… you could put the PHP code that I use in my plugin inside the search.php page in your theme, so that it outputs the string/array value in the HTML source from there. But then, that might not work with your AJAX search that does not require a page refresh…
Not so easy to answer, this one. Sorry.