Category Archives: Javascript

JavaScript Unit Test Gotcha: Element Focus

The task seems simple. Programmatically focus an input element and test whether the element received focus. Using jQuery, both tasks are straight forward:

Everything is right with the world, your tests pass – until you notice tests dealing …

Read more »

Converting a NodeList to an Array in Javascript

Ever wish you could use Array functions on a NodeList returned by element.querySelectorAll or element.childNodes? It’s surprisingly easy! A NodeList is an Array-Like object that contains a .length field, but lacks useful functions like .forEach and .map that make working …

Read more »

Introducing connect-fonts – Connect/Express Font Serving Middleware for NodeJS

I developed connect-fonts for Mozilla Persona over 6 months ago but have never officially released it. Since the project has proven itself both useful and stable, I’d like to share it with the world. Connect-fonts makes it a snap for …

Read more »

Taking over as maintainer of the BrowserID-WordPress (Persona) plugin

Marcel Bokhorst released the original BrowserID-Wordpress plugin less than 24 hours after we opened BrowserID up to the public. He stuck with us through the name change to Persona, has steadily improved the plugin, but would now like to hand …

Read more »

Writing Testable Frontend Javascript Part 2 – Refactor away anti-patterns

This is the second of a two part introduction on how to write testable Javascript UI code. The first article, Anti-Patterns and their fixes, uses a sample application to introduce several common, avoidable, and test-inhibiting anti-patterns. Why these common practices …

Read more »

Writing Testable Frontend Javascript Part 1 – Anti-patterns and their fixes

This is the first of a two part introduction to writing testable Javascript UI code. The first article presents a basic sample application containing several common anti-patterns and their solutions. In the second article, the application will be refactored using …

Read more »

testmob.org – Distributed Javascript Unit Testing

This is a quick post to announce Testmob.org, a site that makes running QUnit tests across multiple browsers easy. TestMob is a distributed unit test system loosely based on John Resig’s TestSwarm. Manual unit testing Javascript across a variety of …

Read more »

The Three Cs of Front End Performance – Concatenate, Compress and Cache

This is a cross post of Fantastic front-end performance Part 1 – Concatenate, Compress & Cache – A Node.JS Holiday Season, part 4, an article that I wrote for Mozilla Hacks. I reduced the content of the article to talk …

Read more »

Chains – Use Composition to Fake Multiple Inheritance in Javascript

Last year I wrote SuperClass, A Complete Bastardization of the Javascript Inheritance Model. Chains is a similar experiment, but instead of single inheritance with a this.super function, the idea is to give Javascript multiple-inheritance like functionality through composition. Chains compose …

Read more »

Adding siteName and siteLogo to the WordPress BrowserID Plugin

I want to post this because it is such awesomesauce. Yes, I’m patting myself on the back. I (as far as I know) have the world’s first WordPress installation that takes advantage of the “siteName” and “siteLogo” feature of Mozilla …

Read more »