Getting Started with ES6 Classes

Though ES6 hasn’t been completely adopted anywhere quite yet (keep up on that), you can take advantage of many of its features today using libraries like Traceur and the ES6 module loader polyfill or using iojs with various –harmony flags (David Walsh has a nice writeup on all the harmony feature flags in io.js). In this post I …

Simple Javascript Table Filtering

Let’s say you have a smallish table that you want to allow your users to filter (via text search), but don’t necessarily want to install another plugin. I recently found myself in this position and decided it would just be easier to make my own simple filter. The requirements were simple: Filter will be a …

jQuery Transactions using Promises

I’ve had a couple projects recently where I needed to perform an action pending the successful completion of a variable number of AJAX requests. In the past, I have used a global counter to keep track of the number of successful requests, in the fashion of: This sort of works, but running the counter check …

Fluent Conference 2013 Links

Here are this most interesting links I took away from the 2013 O’Reilly Fluent Conference, please comment if you have more to share: Online O’Reilly book authoring and consumption: Atlas Beta – The new learning environment from O’Reilly Interesting Global Hackathon with good prizes: Battle Hack – 10 cities + 1 world final == $100,000 …

Firing asynchronous quantcast pixels

If you are building an AJAX-driven web application (like a swipe-driven mobile website) and want to register quantcast pageviews at times other than window.onload, here is a small change to the code snippet quantcast provides that will get you there. Note that this does not remove or replace any existing functionality, you will still need …

Being a Better Javascript Developer

I have gone through numerous phases of javascript development, peer reviewed a metric ton of other people’s Javascript and have experimented quite a bit with the old and new Javascript APIs and have found some common things that make code “good”. My aim is to help you be a more thoughtful javascript developer (though the …

understanding javascript closures

Closures, Lambda, Anonymous functions or whatever else you may call them have become commonplace in modern Javascript, thanks in large part to libraries like Prototype and jQuery. There are many ways to write closures and some common design patterns that utilize closures, I will do my best to explain the what and why. Required Knowledge …

Javascript Templating

I’ve been using a lot of ajax for a recent application and wanted a really lightweight way to do templating for the responses. Long story short, here is the function that extends the String prototype. <code> String.prototype.templatize = function (o) { return this.replace( /\{([^{}]*)\}/g, function (a, b) { var r = o[b]; return typeof r …

jQuery in Windows 8 apps

Though there are numerous work-arounds floating around the web to get jQuery in Windows 8 apps, I have taken it upon myself to port jQuery for Windows 8. Why? Because I wanted plugin-like access to the WinJS events and hooks I don’t need to be cross-browser friendly so I can just use all of the …