Making inheritance make sense with Object.create()

. JavaScript itself is conflicted about its prototypal nature. In a prototypal system, objects inherit from objects. JavaScript, however, lacks an operator that performs that operation. Instead it has a new operator...Prototypal Inheritance in JavaScript, Douglas Crockford The goal is to create a new object with a given prototype link.

The Downside to Ajaxing WordPress

. "Hijax" is a term used to describe a progressive enhancement in which internal site links are "hijacked" by JavaScript in order to load the content dynamically. It reveals to developers a whole new world of interactivity control. It's a fancy and futuristic world—a world not without a gotcha

Code Snippet: Re-enable Ctrl/Cmd-click when using e.preventDefault()

. In Windows and OSX, pressing control or command while clicking a link opens it in a new tab. Using event.preventDefault() on anchor tags breaks this native behavior, but you can use this code to restore it. // allow command-click and control-click to open new tab if (event.metaKey || event.ctrlKey)

Recursion: Nature's Cheat Code

. In his famous 1979 book Gödel, Escher, Bach: An Eternal Golden Braid, Douglas Hofstadter coined "Hofstadter's Law" to describe when computers would best humans in chess: Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. Douglas Hofstadter, Gödel, Escher, Bach: An Eternal

Scratch Style Guide

. Welcome to Scratch! This is your guide to writing beautiful blog posts. All of Scratch's default formatting options are summed up right here. Table of contents Headings Text Blockquotes Lists Media Syntax Highlighting Tables Helper Classes Headings In Scratch, <h1> tags are reserved for site and post titles.

Counterpoint - Hacking the WordPress Loop

. Early on in every web developer's career, there comes a time when the Google teat runneth dry. All of a sudden, your good, clean, best-practiced code is in danger of mutating into cascades of if-statements and ugly hacks, just like your own brain. Stop. Backspace that sentence and a half