This is as days pass by, by Stuart Langridge

And this is No highlighting in searchhi, written , and concerning JavaScript and the DOM, Usability

A chap mailed me to say: is it possible to have your searchhi JavaScript library, which automatically highlights things that the user searched for if they came to your page from Google or similar, not highlight some bits of the page like the navigation section? Good idea, I thought. So the library has now been updated to allow you to do precisely that: stop highlighting bits if they've got a class of nosearchhi. Thanks to Helmut Lorenz for the idea!

Comments

holst

Well, while this on the surface seems like a good idea, I'd really prefer a solution where you would define it in the javascript. "nosearchhi" isn't really a good description of any element, and then it's only a tad better than inline js, in my opinion.

Maybe I should consider editing the script to a more unobtrusive use.

Anyway, searchhi is still a great and very useful script.

bruce

blimey. I was wishing for something like this only yesterday. I owe you a bevvy.

sil

holst: true enough. I could make the class be "infrastructure" (which clearly wouldn't want to be highlighted, as opposed to "content" which would), but it bespeaks a certain amount of hubris. Making it happen from JS would require people to add a load of code to the top of their pages, which would be deeply infuriating to non-coders.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.