Children of The DOM
James Edwards looks at some DOM3 properties that simplify node relationships, by focusing only on element nodes and ignoring other types.
Evolving a New Mutation
James Edwards gets excited about the new MutationObserver API, and talks about how and why it’s come to replace Mutation Events.
Automatic Type Conversion In The Real World
Finding an Ancestor DOM Node
For the eighth article in this small-and-sweet functions series, I’ll be looking at a function called ancestor(). As the name suggests, this function gets a reference to a given node’s ancestor, according to a tag name and/or class match.
A Study in Experimental Game Development
How do you take a nebulous idea and turn it into a game — to get from technical details, to something interesting and challenging? Well recently, I found myself wondering whether CSS transitions could be used to make some kind of game. This article is about the exploration of that idea, and its development into […]
Intelligent String Abbreviation
For the seventh article in the small-and-sweet functions series, I’d like you show you a function called abbreviate() — the main purpose of which I’m sure you can guess! It abbreviates a string to a specified maximum length, but it does so intelligently — ensuring that the split will never occur in the middle of […]
HTML5 introduces a couple of new attributes for implementing browser-based form validation. The pattern attribute is a regular-expression that defines the range of valid inputs for textarea elements and most types of inputs. The required attribute specifies whether a field is required. For browsers that yet don’t implement these attributes, we can use their values […]
Using Web Storage
Welcome to another article in the small and sweet functions series, in which I’d like to show you a neat abstraction called domStorage(), that provides a set of convenient functions for interacting with Web Storage, while discretely handling all the most common points of failure.
Fixing the details Element
Parsing an ISO datestamp
The fifth article in the small-and-sweet functions series is a follow up to the previous article, which showed you a simple function for creating an ISO datestamp. The previous article noted that this format is not supported by some older browsers as input to the Date constructor. This article will show you a reciprocal function, […]