Weblog entry #131 for Steve

Javascript
Posted by Steve on Sun 24 Sep 2006 at 13:58
Tags: none.

I've been having a lot of fun with javascript code over the past few days.

It is fun watching what you can do with just the ability to show and hide named <div> elements.

I should probably investigate tidying things up further - still if you'd like to experiment with what I have so far just send me a message and I'll reply.

I still mostly dislike Javascript, but I'm confident that most of what I've done will work even with it disabled. I use <a href="foo" onClick="bar; return false;"...> which should cause the various links to do the right thing regardless of javascript support being available or not.

Nothing else much to say right now, life is hectic but generally good. Although right now I'm suffering from a badly stored cream-cake. Ugh.

 

Comments on this Entry

Posted by ajt (204.193.xx.xx) on Mon 25 Sep 2006 at 09:31
[ Send Message | View Weblogs ]
Have a look at:

http://www.alistapart.com/articles/behavioralseparation

For even cleaner XHTML/JS separation.

--
"It's Not Magic, It's Work"
Adam

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Mon 25 Sep 2006 at 21:04
[ Send Message | View Steve's Scratchpad | View Weblogs ]

I'm not convinced that the last solution is better to be honest.

I can see that it is nice and pure in the sense that if Javascript is disabled then the A elements won't have the onClick attributes which would be ignored anyway.

But it means that what is executing is not identical to what is served, which would almost certainly lead to me getting confused when it came to debugging

I'm sure for simple effects/uses where things were designed to degrade gracefully, and there weren't terribly complex interactions present it might be OK, but I tend to find that the complexity creeps very easily when you start messing around with DOM stuff - and with that in mind I'd much prefer to see things as viewed by the browser in my editor.

Steve

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search