JavaScript: Learning part 2 and telecommuting
I am reluctanctly admitting that JavaScript isn’t as bad as I remember it. I distinctly recall tons of browser sniffing, JavaScript error messages and thoroughly ugly coding practises. That’s still what I usually see if I’m silly enough to go into a script archive looking for something.
But this DOM Scripting book is painting some really elegant coding. No inserting dozens of things that can’t be validated. XHTML Strict does not like onload or onclick events and I’d had no idea that I could put all of that in my external script file - it was one of the many things that kept me away from the stuff for the past couple of years.
There’s an emphasis on graceful degredation, something that is particularly important if you’re interested in accessibility. That means that, if your JavaScript functions aren’t working in your user’s browser for whatever reason, your page should still work even if the functionality isn’t as wizzy as initially intended. The example they’ve used in the early parts of this book is a really nice image gallery script (I’m probably going to be fiddling with it a little further and adding some styling to put into the gallery on this site) that updates a placeholder image in the page dynamically or just takes you straight to the image if the script can’t work. Much better, to me, than half a dozen JavaScript errors and an end result of never seeing any images.
The last time I attempted to learn JavaScript, there were lots of functions that only worked in certain browsers, absolutely no mention of statements such as document.getElementByID and all the examples did such useless things as putting scrolling messages in your status bar (kill those!!) or changing how half the browser worked without good reason. And it was all shoved into the HTML document with no mention of external files, promising hours of updating if any of the script ever needed changing.
I may even be converted to thinking that really good, well-formed JavaScript is a lovely thing.
In the spirit of National Liftsharing Day, shouldn’t we also have National Telecommuting Day? Far too many employers still refuse to understand why telecommuting could be a good thing for them and their primary objection is too often that they don’t trust employees to do the work. I’m not sure about other workers, but I generally get more done if I’m working from home than I do in the office. I tend to work longer and more intensively without distractions. We have the tech to do it well now, so shouldn’t more employers be actively looking for their staff to work from home a few days a week?