Recent Reading (JS Natives Duke it Out, Regexp in jQuery, Performance, a New Image Format?)

Sorry, it’s been a while. I’ve been busy at work, I’ve been wringing every last bit out of summer on my bike, and I’ve spent a lot of my free time on my upcoming CSS presentation, so I haven’t been posting as much as I would like. Fall is here. Which means I should have more time for writing. That’s cool.

Anyway, to break the ice here are a few articles that have recently caught my attention.
Continue reading “Recent Reading (JS Natives Duke it Out, Regexp in jQuery, Performance, a New Image Format?)”

Front End Performance for the Common Man: Practical Strategies to Speed Up Your Site

Front End Performance for the Common Man: Practical Strategies to Speed Up Your Site from rob larsen on Vimeo.

Follow along with the presentation. (PowerPoint presentation)

Here’s the sample ant build script referenced in the deck. (Zip file)

And here’s the article mentioned in one of the early slides:
Why Front End Performance Matters to Everyone, Not Just the High Traffic Giants

Recent Reading (Analytics, WordPress Short Codes, Jira, JavaScript Videos, Protocol Relative URLS, Facebook)

There’s a lot of content this week, including about 5 hours of video embedded right in the page for your viewing pleasure. Enjoy.

Analytics – The Usability Lab of the new decade

Peter Merholz from Adaptive Path talks up analytics. Don’t I feel like a smart guy with all my fancy analytics experience?

That’s probably something I don’t talk enough about here- analytics. I’ve got a ton of experience with both Omniture and Google Analytics, doing some pretty advanced work. I should share that.

Anyway, good article talking about the UX benefits of analytics data. Check it out.

Short Code resources

This is a little resource page from one of the WordCamp Boston Ingite talks. WordPress Short Codes are clearly awesome and I don’t use them enough. I aim to change that.

I’m actually using them for the table of contents on my ongoing How To Make a Web Site series.
Continue reading “Recent Reading (Analytics, WordPress Short Codes, Jira, JavaScript Videos, Protocol Relative URLS, Facebook)”

The JavaScript NodeList and You. Watch Where You Point That Thing, Soldier

I saw this tweet yesterday and was reminded , once again, of how misunderstood the return value of a DOM method like document.getElementsByTagName is. Normally, it doesn’t matter that folks don’t really understand the return value fully, because most of the time the code just works. Where it breaks is interesting, so it’s worth taking a look at it in a little bit of depth.

Typically people do things like this:

var anchors = document.getElementsByTagName('a'); 
for (var i = 0; i < anchors.length; i++) {
      anchors[i].addEventListener("click", beAwesome, false)
}

Common pattern. Get a list of the anchors on the page, loop through and add an event to each.

If asked, I’d be willing to bet most people would assume that the list they’re interacting with is an Array. It’s got a length and you can index it- that’s got to be an Array, right?

Surprise! 🙂
Continue reading “The JavaScript NodeList and You. Watch Where You Point That Thing, Soldier”

getElementsByTagNameNS. Now I Know. And Knowing is Half the Battle.

Yesterday I was wondering why obj.getElementsByTagName wasn’t working in Safari/WebKit on a tag with a namespace prefix. I wondered, aloud, whether or not it was just something I was ignorant of.

It turns out that was the case. Dom Level 2 added new namespace specific methods to search through documents or document fragments for tags of a specific NameSpace. I’d just never had to use them before. Learning that greatly simplified the hacky code I wrote yesterday. Here it is, new and improved:
Continue reading “getElementsByTagNameNS. Now I Know. And Knowing is Half the Battle.”