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.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org