JavaScriptiness (thanks_dunstan.js)

Server-side scripting came really easy to me when I decided to learn PHP late last year. It’s basically the same as console C++, which I studied a lot in my college Computer Science classes. A request comes in, or a user starts the program, it does stuff, and outputs results. Sure, with PHP, the results are generally XHTML and other browser-parsible goodies, but the theory is not far off from what I’d done before. Having worked at a company for almost 2 years now where our main product is a server-side SQL/IIS application, the concept of pulling records out of a database was straightforward.

Recently, I’ve been studying JavaScript and the DOM, which have always been like a foriegn language to me. But it’s some cool stuff. Of course, I’m of the opinion that anything which can be done with markup (XHTML or CSS,) should be. What can’t be done in markup should always be done server-side if possible, where everything can be controlled easily, and only then should client scripting be used. And, sites that are just dripping with JavaScript usually are more annoying than cool. Like anything else, client-side scripting must be used only when it is the best or only solution to a particular problem, and when it causes fewer/smaller problems than it solves.

Read on for the recent enhancements.

For the moment, my site is bit of a Javascript nightmare. I’ll be scrapping most of the fancy titles soon, but Dunstan Orchard has some downright cool stuff on his demo site. If you float your mouse over the links on this site, you’ll see a super-snazzy title effect. I don’t use accesskeys much on this site, but if I did, you’d know it, thanks to Dunstan’s contribution.

For my part, I managed to add some bits to this script, bringing the total number of contributors for this version of “NiceTitles” to 5.

Credit where credit’s due:
// original code by Stuart Langridge 2003-11
// with additions to the code by other good people
// thank you, sir

// modified by Peter Janes 2003-03-25
// added in ins and del tags

// modified by Dunstan Orchard 2003-11-18
// added in accesskey information
// tried ever-so-hard, but couldn’t work out how to do what Ethan did

// final genius touch by by Ethan Marcotte 2003-11-18
// worked out how to delay showing the popups to make them more like the browser’s own

// Modified by Isaac Z. Schlueter on 2004-08-10
// added span, dfn, acronym, and abbr (abbr not supported in IE!)

Also, I grabbed Dunstan’s blockquote coolness, so that blockquotes with this sort of markup:<blockquote cite="" title="Isaac Z. Schlueter">My favorite thing in the world is "The Click." It's even better than cookies or pretty girls.</blockquote>will automagically turn into this:

My favorite thing in the world is “The Click.” It’s even better than cookies or pretty girls.

(Check the source if you don’t believe me! Neat huh?)

I found a few other things, and I’m thinking of a new way to do the menus and sidebar on this site that would be a little more user-friendly by sprinkling some homegrown scripts. Stay tuned for more shifty changey things!

One Response to “JavaScriptiness (thanks_dunstan.js)”

  1. On August 23rd, 2004 at 12:40:58, tin-men Said:

    Can’t think of a titleHmm. I’m finishing work at OPERA on Wednesday, and I’m off to Reading on Thursday. I’m looking forward to finishing work, since it will give me a few days to spend with Nina, since I’m off to MMU in a couple of weeks. I also intend to overhaul the skin here (but it probably won’t be a whole new skin). There’s a couple of things I saw over at Isaac’s site that I fancy implementing here, along with…

Leave a Reply

Comments are moderated like crazy using a variety of plugins. There is a very high likelihood that your comment won't show up right away, especially if you have never commented here before, but it was not deleted.

Please be patient, and do not post your comment more than once. It will show up once it is approved.

You must be logged in to post a comment.