Julius Plenz – Blog

Kamusi and jQuery

So some years ago I was what what one would call a Web Designer, doing CSS and XHTML 1.0 and that stuff. I got bored, however, and nowadays I hate these websites that are so over-styled and have so much JavaScript in there. I have been turning away from any web-related stuff since the times writing valid XHTML 1.0 was still "in".

However... today I tried this whole "Use JavaScript instead of regular links and reloads" stuff out. Friends of mine suggested using jQuery, of which I grabbed the "mini" version. (There have been some really clever code golfers at work to shrink the whole library down to some 77K. In that format, it's barely human-readable, though.)

jQuery is nice, because it doesn't have many JavaScript parts in it. The "usual" stuff seems to work by simply combining elementary jQuery functions, for which there's a great API documentation, and identifying HTML objects in a syntax similar to CSS.

So without really understanding how and why it works, I created a Web2.0-ish version of my kamusi command line client. Kamusi is the Kiswahili word for dictionary, and the program I wrote is a text-based interface written in Perl for the extensive database of words from http://kamusi.org/. Their web search, however, is very slow and irritating to use.

My hack-away implementation of a cleaner, faster search using jQuery and a custom CGI to retrieve the results can be found at http://k.plenz.com. Some sample queries you might try: -nia, bongo or -pa. Source code is availabe in the "cgi" branch on Github.

This jQuery stuff is hard to debug, actually. (JavaScript in general is, IMO.) However, the syntax is pretty straight-forward. I do realize now why so many of these Web2.0 pages use this fading and scrolling-in stuff so much (and autosuggest, as well!). It's just plain easy and provides a feel of using a "dynamic application".

I can understand now why these Web Designers are so proud of themselves.

posted 2011-01-10 tagged kiswahili, kamusi and jquery