Weblog entry #131 for Steve
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
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 ]
[ 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.
[ Parent | Reply to this comment ]