robinturner: (Default)
[personal profile] robinturner
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.

Geek reply

Date: 2003-03-16 05:40 am (UTC)
From: [identity profile] hfx-ben.livejournal.com
I've been keeeping my eye on menus ... looking for something that suits my idea of a good page layout ... http://www.10East.com is pretty much it, for me.

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)
From: [identity profile] solri.livejournal.com
The effect on 10East.com is pretty doable (check out the source code for the page - you'll need to type in the address for the script, since it's not part of the main page).

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)
From: [identity profile] hfx-ben.livejournal.com
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

Profile

robinturner: (Default)
Robin Turner

June 2014

M T W T F S S
      1
2345678
9101112131415
16171819202122
232425 26272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags