KBD

Keith Devens .com

Sunday, September 7, 2008 Flag waving
Premature abstraction is an equally grevious sin as premature optimization. – me

Archive: April 29, 2003

← April 28, 2003April 30, 2003 →

Daily link icon Tuesday, April 29, 2003

Short language references needed

Damnit, once I get my wiki up I'm going to start keeping track of short language tutorials. I'm starting to use javascript again, and I'm starting to run into the same stupid things I always run into when I need to pick up a language I haven't touched in a while. Say it with me now... "How do I do that again?" Smiley

Luckily I got the JavaScript pocket reference for just such an occasion. Though I don't have the newest version. At least I can rest my eyes looking at real paper instead of the screen Smiley

Client-side word highlighter

Ok, I'll look into doing a client-side version of it. Time to learn the DOM better.

Search term highlighting on my site

New feature: click through to my site from a search engine (try the first link on this search), and you'll get to see the new feature. It pretty much explains itself. Smiley You may have to refresh the page, however, if the page is stored in your disk cache.

I took one regular expression trick from Dean Allen (thanks Dean).

Two issues: I can't do real highlighting of search terms of more than one word. Say you have a phrase in which one word is <em>emphasized</em>. If you search for "one word is emphasized", there's no real way to highlight that with regular expressions, since you could have an arbitrary nesting of HTML. "one word is <strong><em><span>emphasized</span></em></strong>"... etc. Is there a trick I don't know about?

The problem could theoretically happen even within one word, since you can have HTML markup within a word, but that's very rare.

The other issue is that I'd probably like to somehow make you only see the highlighted words once, so if you're browsing back and forth around the site you don't keep seeing these ugly yellow words staring you in the face. Not sure whether this is a feature or a bug as it stands. Hmm... by the way, it's super easy to set different caching levels in my CMS. To turn caching off, for instance, all I have to say is $cms->setSetting('http.cache',0). Smiley

Lastly, I may eventually do multi-color highlighting like Google does. But plain old yellow will have to suffice for now.

← April 28, 2003April 30, 2003 →
September 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 6 posts

Recent comments XML

new⇒I hate Norton Antivirus

Long long live AVG I love you!...

kevin sands: Sep 6, 7:31pm

I hate ASP.NET

CF, why pick that piece of trash?​Cold Confusion. Is it finally​really a OO...

ColdConfusion: Sep 5, 8:36pm

Maps of Iraq

This is for Linda, I will be​visiting that site some time in the​near futur...

Bob: Sep 5, 1:20pm

Girls, please don't get breast implants

Well alright I just read my above​comment and I wanted to add​this...I shou...

76.66.140.8: Sep 4, 7:31pm

Spider solitaire

I don't think the question was​necessarily if there are unbeatable​games.  ...

Jared: Sep 4, 12:44pm

Convert Pantone Colors to RGB and Hex - Color Conversion Chart

The colors on those website don't​seem to relate to the pantone data​we hav...

blah: Sep 3, 10:12am

Generated in about 0.044s.

(Used 7 db queries)

mobile phone