Skip to main content

Climbing up and down the DOM tree with vanilla JavaScript

On a recent Javascript project, I needed to climb up the DOM tree looking for the first element that had a particular class, ID, or data attribute.

This is really easy to do with jQuery, but today I wanted to share some simple vanilla JavaScript methods to duplicate jQuery’s .closest(), .parent/s(), and .find() APIs.

Read More…

Ditching jQuery

About a year ago, I wrote an article documenting my move away from jQuery in favor of modern, native JavaScript (aka vanilla JS).

Since that time, my approach has changed quite a bit. This article details how I write scripts today, and includes a growing collection of native JavaScript equivalent’s for common jQuery tasks.

Read More…

Farewell Constant Contact

Today is my last day at Constant Contact, a company I joined just four short months ago.

I’ve never felt more at home professionally. Constant Contact is filled with geeks with social skills—some of the most amazing, quirky, and friendly humans I’ve ever had the pleasure of knowing and working with.

But my daily commute is about three hours long. The summer disappeared. I’m missing some of the best moments of my son’s life. And I’ve been offered an amazing opportunity that allows me to work 100% remotely, on my own schedule (more on that some other time).

I struggled with this decision. Not only are the people amazing, but it has an insanely strong learning culture. Lunch and learns, conferences, memberships, outside speakers—and of course the informal stuff I’ve picked up from the other talented people I work with.

Leaving that behind, and so abruptly, is hard. But missing out on my life is harder. And I’m both fortunate and grateful to work in a field that affords me plenty of options and opportunities that other people in other industries don’t have.

So a very big, heartful thank you and goodbye to my friends at Constant Contact. I’ll truly miss you guys!

Humans Need Not Apply

C.G.P. Grey’s latest video, “Humans Need Not Apply,” is a pretty radical departure from his normal style of video. At 12 minutes, it’s much longer than his typical video. He talks much slower, and instead of his normal animations, uses lots of video clips.

In my opinion, it’s the best video he’s ever produced, and reminds me very much of the Everything is a Remix series (while still being uniquely Grey).

A few thoughts…

Responsive sticky footers

If you have footer content on a page with little body content, the footer may end up floating in the middle of the page on taller viewports.

Most of the solutions you’ll find on the web require you to apply a fixed height to your footer (see here, here, and here), or apply the display: table property to your content. Of course, if your site is responsive, the height of the footer will vary by viewport. And telling a table-less layout to behave like a table just feels wrong.

Today, I want to share my simple technique for responsive, sticky footers.

Read More…

Function.prototype.bind and Opera Mini

Last week I discovered that a few scripts that should work in Opera Mini were not. And they weren’t just failing to work. They were passing the mustard test, so important content was getting obscured with no way to access it.

The problem turned out to be with Function.prototype.bind, a late addition to the ECMAScript 5 standard that is missing from some otherwise compatible browsers (like Opera Mini). Fortunately, there’s an easy fix.

Read More…

Da Art of Storytelling

I wish more hip-hop artists had the lyrical substance and depth of Andre 3000:

She said, “Why you in the club, you don’t make it precipitate? You know, make it rain when you can make it thunderstorm?”

I’m like, “Why?” The world needs sun. The hood needs funds. There’s a war going on and half the battle is guns. How dare I throw it on the floor when people are poor, so I write like Edgar Allen to restore. Got a cord, umbilical, attached to a place that can’t afford no landscaping, or window draping.