Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
|
I wonder if it is possible to adapt that code to instead of searching the one page, to search the whole website!
|
As Sam told you, you cannot do that in javascript alone.
Javascript is a local side language, that works into the web page currently displayed.
It can access other pages (via xmlHttpRequests, or ajax if you prefer) and parse them, but you'll have to give the script a list of every url's it have to look into.
And it would take a pretty long time, as it would be the same than a user accessing all the page of the site in a quick sequence.
Very resources unfriendly...
No, the best way is (if your content is in a database) to setup the search via the database.
Or by using something like a google search box restricted to your site.
__________________
Only a biker knows why a dog sticks his head out the window.
|