Geek post - anti-javascript rant
Sunday, March 16th, 2003 02:33 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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?
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.
}
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.
Geek reply
Date: 2003-03-16 05:40 am (UTC)BTW I'm taking on PHP right now, finally, after putting it off all this time. JS is next.
Re: Geek reply
Date: 2003-03-16 06:28 am (UTC)If your server supports PHP, you may well not need to bother with JS. Its main advantage is that everything is done client-side, so people whose servers do not support PHP or CGI can reproduce some of the effects that these provide. The things I've used JS for (e.g. randomising text), I could have done more easily with Perl-CGI, but our university doesn't allow a non-CGI server to call CGI scripts (actually a pretty sensible security measure).
Re: Geek reply
Date: 2003-03-16 07:29 pm (UTC)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