Prepare a sorted index of the words in a document, put it in a select tag; use it for searching and make it roll automatically alongwith typical search box and dblclickking a word.
This utility has been used in XP and IE8 for searching technical documents of text / html types and it does the following:
a) encapsulates the file, opened from the input file-type-tag, into a <DIV>, adding <br> for line breaks of text files (an <IFRAME> messes up)
b) collects all the words and compiles an INDEX of the words, sorting and removing duplicates
c) the index is put into a <SELECT> element from where a word can be selected to search the whole document
d) the normal search box is in an input element; an entry here rolls the <SELECT> and vice versa
e) double clicking on a word selects and searches more of it in the whole document
f) the double clicked word rolls into the other two modes of search
g) the total number of founds is shown and the document scrolls to the first found
h) mouse over a found shows its score
i) the Next button scrolls to the next found
j) the code includes indexOf routine for string prototype.
The code is in the enclosed zip.
Have a nice day.