PPRuNe Forums - View Single Post - Adding search box to HTML document
View Single Post
Old 17th March 2023 | 08:22
  #6 (permalink)  
Jhieminga
Community Builder
20 Countries Visited
20 Anniversary
 
Joined: Mar 2002
: CPL
Posts: 3,392
Likes: 325
From: near an aeroplane
For the Google box to work, the pages you are searching must be visible on the internet and have been indexed by Google. When you set up the box, you can specify to search a specific domain and if that contains the document you mentioned, it should work. Yes, you will get additional 'results', it is Google after all....

Edit: searching a specific page is actually more complex than you would think. The challenge is in defining the range to be searched and storing that temporarily. You can also just put a snippet of text at the top to say 'Hit Ctrl-F to find what you want, or Cmd-F if you're on a Mac'.
There is an explanation of how it works in Javascript here: https://dev.to/am20dipi/how-to-build...avascript-4onf but that uses a pre-defined array of names as the search range.
Jhieminga is offline  
Reply