robinturner: (Default)
Robin Turner ([personal profile] robinturner) wrote2003-03-16 02:33 am

Geek post - anti-javascript rant

I spent several hours today trying to make sense of a bunch of javascript I downloaded which adds dropdown menu-style navigation bars to your site. After tweaking persistently, I got the effect I thought I wanted then decided it wasn't worth trebling the size of my code for. I mean seriously, what kind of language has syntax like this?


}
if (isDOM) {
var newDiv = document.createElement('div');
document.getElementsByTagName('body').item(0).appendChild(newDiv);
newDiv.innerHTML = str;
ref = newDiv.style;
ref.position = 'absolute';
ref.visibility = 'hidden';
}

This makes Perl seem positively transparent.

Dropdown menus aside, are there any really useful uses for javascript? A glance at any website offering downloadable javascripts is full of scripts to make the mouse cursor turn into an animated head of George Bush, draw Christmas tree decorations round the edge of the browser window, or find out what browser your visitor is using and manipulate the content accordingly (as if it makes any difference - write your pages in clean, W3C-compatible HTML, and if they can't read it, it's their own sodding problem). OK, there's the famous javascript mouseover effect, which can be useful sometimes, but most of the time you can do it with CSS, and most of the rest of the time, it's just tacky. I've seen a few sites use it to good effect (e.g. www.whatisthematrix.com ) but usually it's just another way for webmasters to annoy people with low bandwidth.

As for Flash animation - no, I won't go into that.

Re: Geek reply

[identity profile] hfx-ben.livejournal.com 2003-03-16 07:29 pm (UTC)(link)
1) I'm looking to find who supplied 10East with the script ... pretty sure it's free for credit.
2) I'm actually hoping to use JS client side with PHP server side ... working up an extended blog-type system. (Have you gotten into full-text searching? "Transparent inference" has whetted my appetite for this task.)
3) My university supported cgi at least partly by providing cgi-wrap ... no symlinks though, which caused some problems.
good luck