Tags » JavaScript

WebSocket sessions in NodeJS with Express

WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. However, keeping track of sessions in both HTTP and WebSocket…

Continue →

Deferrables

Imagine, if you will, some JavaScript models that look something like this: function User (…) { // initialise user } User.fromId = function (id, cb) { // 'returns' an error, or a User db.find(…, cb); } User.prototype.getGroups = function (cb) { // 'returns' an error, or an array of Groups db.find(…, cb); } function Group…

Continue →

<noscript>

When I was but a fledgling web developer, JavaScript was a toy; a little bit of DOM manipulation (or DHTML, if you will) was about as good as it got. It certainly wasn’t being used to make full-blown client-side (or indeed server-side! 1) applications, and if you told someone you were going to generate all…

Continue →

A little journey into touch events and transitions

I’ve been doing a bit of R&D into some badge-related mobile stuff, and playing with touch events to get some swipe-like behaviour. While this is more of a gripe than a tutorial, I’ll go through the process anyway, for those of you following along at home. First things first, we have to listen for a…

Continue →