Thanks to Alex for reporting the issue, I have updated my Search Engine Highlight Javascript to 1.2. Here are the changes:
- Fix up the bug when search keyword containing partial match of ‘
span class="hilite"‘. - Having an extra boolean flag
Hilite.exact, whether the parser should perform exact match. Default to true, i.e. searching for “search” will not match “searching”. - Minor performance optimisation.
Download the latest version of Search Engine Highlight Javascript.
Nice work! I came across your script just the other day, and was puzzled by the partial match problem.
Although, now I am seeing a literal “$&” (dollar ampersand) in the display of Safari 1.3. How is that meant to work? Thanks!
I have not had a chance to test it on Safari 1.3 as I am still on Panther. However, it looks like the regular expression in Safari does not support ‘$&’ to substitude with group 0 in match.
I realy like this script since it still allows me two write HTML. I hope its oke for me to cut out most the comments. This saves me 40% on the file size. (My users don’t need to download that.) I did leave the credits in. I kept the comments for my self in a se_…txt file.
No problem. Do whatever you want.
You can also trim it to fit into the your main HTML page, or together with other Javascript you have got on the site, so that it would involve less HTTP transactions to your server.