James is a freelance web developer based in the UK, specialising in JavaScript application development and building accessible websites. With more than a decade's professional experience, he is a published author, a frequent blogger and speaker, and an outspoken advocate of standards-based development.

James's articles

  1. Fixing the details Element

    The HTML5 <details> element is a very neat construct, but it also has quite a serious usability problem – what happens if you follow a hash-link which targets inside a collapsed <details> element? The answer is nothing. It’s as if the target was hidden. But we can fix that issue with a little progressively-enhanced JavaScript, […]

  2. 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, […]

  3. Accessibility in Modern Interfaces

    Some of the things being done with JavaScript today are truly amazing. The Internet itself is still young, yet it’s been through several evolutions in its short history – most significantly perhaps, is the explosion of incredible Web applications that came in the wake of AJAX. There was a loser though, and that was accessibility. […]

  4. Creating an ISO datestamp

    The fourth article in the small-and-sweet functions series introduces a function called datestamp(), which uses various JavaScript Date methods to produce a UTC date-string in the ISO 8601 format, like “1991-08-06T08:30:00Z”.

  5. Practical JavaScript Accessibility

    This article will show you some simple things you can do right now, to make your JavaScript more accessible. This is not bleeding-edge technology, but stuff we’ve been doing for years. This post expands on our introductory article, “JavaScript Accessibility 101.”

  6. Removing Useless Nodes From the DOM

    For the third article in this series on short-and-sweet functions, I’d like to show you a simple function that I find indispensable, when working with the HTML DOM. The function is called clean(), and its purpose is to remove comments and whitespace-only text nodes.

  7. JavaScript Accessibility 101

    There was a time when JavaScript Accessibility simply meant ensuring graceful degradation when JavaScript was unavailable. But, since the explosion of Ajax and Rich Internet Applications, JavaScript isn’t just used for non-essential usability enhancements. JavaScript is now the core of web-based applications, so when we talk about JavaScript accessibility today, we mean that the JavaScript […]

  8. Why Would You Write Your Own CMS?

    Stepping into the ever-raging debate about which is the best CMS, James Edwards looks at the case for writing your own custom solution. With recent hindsight he discusses why he chose to write his own CMS, and then goes on to outline the benefits — and the drawbacks.

  9. Test for Empty Values in Javascript

    The second article in our series covering short, but sweet, functions discusses the problem of testing for empty values. The function in question is called empty(). Similar to the PHP function of the same name, it takes a variable or property and tells you if the value is empty. The definition of empty depends on […]

  10. Adding Micro-Constructors to a Modular Design Pattern

    Recently on JSPro I wrote about a modular design patterns, with four different member types providing a high-degree of flexibility over how a script is organised. In this follow-up article, I’ll be looking at a way of extending that pattern by adding micro-constructors, public functions that are object constructors, so you can have multiple independent […]

  11. A Utility Function for Padding Strings and Numbers

    Welcome to the first post in what will be an ongoing series of articles which looks at a single JavaScript function — something small but powerful, that does one thing well. To kick the series off, this article focuses on a function for padding values with leading characters. This type of function is particularly useful […]

  12. Modular Design Patterns: Private, Privileged, and Protected Members in JavaScript

    In this article, I’ll be describing the structure and benefits of an extended modular design patterns, that includes four principal member types: public: members that can be accessed from anywhere private: members that can only be accessed from inside the object privileged: members that can only be directly accessed from inside the object, but which […]

  13. Multi-threading in JavaScript

    No, you can’t really multi-thread in JavaScript, but James shows the advantages of simulating a multi-threaded environment when dealing with intensive code. Armed with the techniques in this article, the possibilities for what you can achieve with JavaScript are limitless!

  14. DesignFestival: JavaScript Design Patterns Deconstructed

    All sophisticated design patterns throw up the same fundamental question — is there a concrete advantage to using it in the first place? Without understanding the benefits, it could be very easy to think that it’s just a pointlessly verbose and over-engineered solution, or that it’s only following some kind of fashion. But there are real and important benefits to using this kind of pattern, and it isn’t an attempt to make JavaScript “more like” any other language, or to mimic classical inheritance.

  15. JavaScript Design Patterns Deconstructed

    All sophisticated design patterns throw up the same fundamental question — is there a concrete advantage to using it in the first place? Without understanding the benefits, it could be very easy to think that it’s just a pointlessly verbose and over-engineered solution, or that it’s only following some kind of fashion.

  16. DesignFestival: One JavaScript Design Pattern I Can’t Live Without

    I thought it might be interesting to look at a JavaScript design pattern that I use a great deal. I settled on it gradually, over a period of time, absorbing and adapting influences from various sources, until reaching a pattern that offers the flexibility I need. Let me show you an overview, and then look at how it comes together: function MyScript(){} (function() { var THIS = this; function defined(x) { return typeof x != ‘undefined'; } this.ready = false; this.init = function() { this.ready = true; }; this.doSomething = function() { }; var options = { x : 123, y : ‘abc’ }; this.define = function(key, value) { if(defined(options[key])) { options[key] = value; } }; }).apply(MyScript); As you can see from that sample code, the overall structure is a function literal: (function() { … })(); A function literal is essentially a self-executing scope, equivalent to defining a named function and then calling it immediately: function doSomething() { …

  17. One JavaScript Design Pattern I Can’t Live Without

    I thought it might be interesting to look at a JavaScript design pattern that I use a great deal. I settled on it gradually, over a period of time, absorbing and adapting influences from various sources, until reaching a pattern that offers the flexibility I need.

  18. The Ever-Increasing Uses of a Zoom Layout (Part 1)

    In the first of a two-part article, James examines an accessibility technique that benefits low-vision users, and shows how it also has a host of other uses, like providing for handheld devices, serial devices, print media, older computers, and legacy browsers like IE5.

  19. The Angst of Accessibility

    In a follow-up to “The Art of Accessibility”, James considers why accessibility should provoke such a strongly negative response in some. Indeed, why should an issue that’s rooted in improving the user experience, provoke any objection at all?