Tag Archives: javascript

jQuery Logging

I’ve been having a lovely day at work, fiddling with jQuery. I started to come up with some really gnarly selector chains though, and I wondered what nodes they were actually addressing. So, I wrote a tiny jQuery extension that logs the current jQuery selection to the firebug console. jQuery.fn.log = function (msg) { console.log("%s: […]

Practical Fascism

On my recent project at work, I’ve instigated a number of features: An XSLT stylesheet that strips out all inline JavaScript and inline CSS before it ever hits the browser. Go-go Unobtrusive JavaScript! Lots of jUnit tests: Every piece of static HTML gets validated via RelaxNG (we had to use RelaxNG in order to allow […]

jslint4java 1.1

I’ve put out a new version of jslint4java. The changes aren’t huge, but there are a couple of note: Fix Issue 1: a NullPointerException when jslint gives up. This is doubly annoying because it’s both documented and it caught me out when writing the Perl wrapper, JavaScript-JSLint. I’ve added an ant task so you can […]


A while ago, I wrote a small wrapper around jslint in Perl: JavaScript-JSLint. However, it’s a real pain to use. There’s a dependency on JavaScript, which in turn needs a compiled version of spidermonkey. On a recent Java project at $WORK, I wanted to use jslint as part of our unit tests—evil JavaScript be gone! […]

JavaScript URI Objects

I started looking at a dashcode project the other day. Within a few minutes, I realised that I needed something like URI.pm, in order to resolve URIs into an absolute form. I had a quick look around and there didn’t seem to be anything code out there that does this. So, I had a quick […]

Pro JavaScript Techniques

I’ve just finished Pro JavaScript Techniques by John Resig (author of jQuery). It lives up to the name. If you’re a beginner with JavaScript, then look elsewhere. But if you’ve done a little bit before, then this is the book for taking you to the next level. From the very start, it pulls no punches. […]

jQuery in Brighton

I went to see Jay Caines-Gooby talk about jQuery last night. It was part of the Sussex Geek Dinner thing. jQuery looks really, really cool. I like prototype, but jQuery looks like it tries to do less. I was particularly impressed at Jay mentioning that the developers were taking features out. There are plugins for […]

dTrace & JavaScript

dTrace is one of those really, really cool technologies I wish I’d had back when I was a wookie^Wsysadmin. It lets you monitor and profile your system in ways which just weren’t possible before. It’s Solaris only at present, but it’s being ported to FreeBSD and Mac OS X. But the cool thing is watching […]

Decorated JavaScript

I’ve just read The Decorator Pattern for JavaScript. It’s a beautiful example of precisely how flexible a language like JavaScript is. The technique described allows you to run functions before and/or after any function on any object. The code is fairly understandable as well. When you set up an object as “Decorated”, it adds before() […]

JavaScript on OSX

So, after my little rant a few days ago, I’ve now gotten JavaScript::JSLint up and running. But that involves downloading a lot of Perl modules, and installing SpiderMonkey, which is a none too pleasant task. However, the Mac should already have JavaScript built in—JavaScriptCore, which is part of WebKit, which is used to build Safari. […]