Rob Larsen

Archive for the 'javascript' Category

My New GetElementsByClass() + a Safari 3.1 Oddity

To make use of the native getElementsByClassName I rewrote my getElementsByClass function to use the method where possible.

Here's the code*:
(more…)

Books 2008 #11 JavaScript: The Good Parts

JavaScript: The Good Parts: I have to say I was somewhat disappointed with this book from Douglas Crockford, one of the leading voices in the JavaScript community. I normally enjoy Crockford's in-depth, direct style, but in this book it's so stripped down there's nothing to really hang onto. Billed as a book for experienced programmers looking to get into the language, JavaScript: The Good Parts is a decent read that meets the stated goal with a pamphlet sized examination. The problem is, it does little else. The thin size is offered as a benefit and I guess in some ways it is since it's such a low barrier to entry, but for my money, something like ppk on JavaScript, is a far superior introductory book as it presents similar information with enough depth to really provide insight into the intricacies of JavaScript. Not so here. There are large sections of this book that read like a decent web page. Which is great if you're on the web, I'd love to find a resource like this on the web, but not so great if you've just dropped $20 bucks on yet another O'Reilly book.

I don't want to completely diss it as it is a straightforward introduction by one of the language's leading experts that will serve as a fine introductory text for some people. I just can't help but feel like I'm missing out on a hundred or so pages of Crockford's insight.

Webmonkey Relaunches and I Flashback to the 90s

For real! I ran through all of the primordial webmonkey tutorials* when I was starting out building sites (10-11 years ago now!) and if the newly relaunched site is half as helpful it will be a great boon to the community. Great info and a friendly, funny attitude made it the place for me to learn about the web thing back in the last century. Honestly, I owe a lot to the usefulness of those early tutorials. Looking back on it I realize that Webmonkey, coupled with the community that sprang up around Dreamweaver at the time**, was a great forge upon which to build up my web chops.

We're Back! Webmonkey Relaunches, Rejoins Wired

The original web developer's resource has returned. Webmonkey has been completely redesigned, and we're ready to rock once more. Also, our entire content library is now hosted on a wiki, so every tutorial, reference page and code example is open for editing. Come on in and show us what you've got!

Webmonkey: the Web Developers Resource

*Some still exist: like Thau's JavaScript Tutorial, which is over ten years old now.

**I've been a Dreamweaver user since Version 1.2.

Google Doctype – First Pass? Very cool.

Google Doctype, as introduced by Mark Pilgrim:

The open web is the web built on open standards: HTML, JavaScript, CSS, and more. The open web is a beautiful soup of barely compatible clients and servers. It comprises billions of pages, millions of users, and thousands of browser-based applications. You can access the open web with open source and proprietary browsers, on open source and proprietary operating systems, on open source and proprietary hardware.

Google has built its business here, on the open web, and we want to help you build here too. To that end, we are happy to announce the formation of an encyclopedia for web developers, by web developers: Google Doctype.

Google Code Blog: Introducing Google Doctype

Personally, I'm excited by this development (both practically and philosophically) and will likely contribute wherever it makes sense for me to lend a hand. Looking at it quickly some of the HOWTO information is already very useful (the web security information especially) and it will only improve with time as more and more dedicated people get involved with the project.

A Small Site Enhancement

I made the image in my gallery pages "hot" today. Each gallery image now points to the next image in the gallery flow. It'll be interesting to see if that increases the average number of page views per user. I'm thinking it will as a lot of people use that technique so I'll hopefully be leveraging that learned behavior. Logically it just makes sense as those back, home and next buttons are way too small. I'll report the results in a couple of weeks…

Check it out here.

I'm actually in the process of recoding all the gallery pages (with the exception of the alphabet I posted yesterday, which was built that way from the beginning) to have an actual anchor tag wrapped around the image. For now I'm doing it with a little bit of JavaScript:


var imgs = $("artimg").getElementsByTagName("img");
for (var i=0; i< imgs.length; i++) {
    imgs[0].onclick= function() {
        document.location.href=$("next").href;
    }
}

where "next" is the existing ID applied to the next link in gallery pages. I love being able to use such simple JavaScript to enhance the user experience in such a (potentially) large way.