Category: JavaScript



Busy at JSConf EU, but it bears mentioning that 2.0 is now in beta. The main new feature put a few gray hairs on my head: it will “optimize” certain animations to be GPU-accelerated in capable browsers, including MobileSafari on iPhone and iPad. Here’s a demo that explains it in greater detail.



Feast on slides: How Custom Events Will Save the Universe, a talk I gave yesterday at TXJS. (Travel can be fun, but you can’t beat conferences held where you live.)



Mock geolocation

Useful if you’re working on a website meant for mobile devices. Firefox 3.5 has geolocation, but I use this with Safari and GreaseKit. Replace with whatever latitude and longitude you prefer, naturally.

if (!('geolocation' in navigator)) {
  navigator.geolocation = {
    watchPosition: function(success, f, options) {
      var broadcast = function() {
        var position = {
          coords: {
            latitude: 30.2696384,
            longitude: -97.74947,
            accuracy: 10000,
          timestamp: (new Date()).valueOf()

      window.setInterval(broadcast, 10000);



Thomas Fuchs just pushed out the alpha 5 release of scripty2. This is the first release to include the small handful of UI controls I’ve been writing. The controls are designed to be compatible with jQuery UI’s Theme API — meaning that, for instance, a theme built with ThemeRoller could be dropped into a site using scripty2, and vice-versa. More to come!



The “Configurable” pattern

If you don’t know about RaphaĆ«l, you’d better ask somebody. It provides a vector drawing API that works in all major browsers (by abstracting between SVG and VML).
I’ve been working on a JavaScript charting library called Krang. Krang is designed to take a data set and produce any chart (line chart, pie chart, bar



Deep-extending objects in JavaScript

Today I’m going to be talking about Object.extend without much introduction or context. Bear with me. This is a prerequisite blog post for something I’ll be talking about in a few days.
Extending objects in JavaScript
Prototype has a function named Object.extend. It takes two objects and copies all properties from the second object onto the first.



Panel audio from The Ajax Experience

I just discovered the existence of audio (and slides) for two of the sessions I was involved with at The Ajax Experience 2008, held in Boston last September.
Which is to say: I knew that audio existed, but didn’t know it was yet available anywhere.
The first was PPK’s main-hall session: Top 10 Cross-Browser Issues. This was



InfoQ posted a “virtual panel” in which framework authors answer questions about HTML5. Thomas Fuchs and I, among others, answer questions about how (if?) HTML5 will make our lives easier, and what more we want out of JavaScript in the future.



Dean Edwards explains how the standard “callback” pattern in JavaScript is too brittle for something like a “DOM ready” event. Prototype appears to be the one major library that handles this “correctly.” WIN!



That SXSW panel I was on the other day (I am, um, awful at self-promotion, even on my own blog) has already been released via podcast, to my own astonishment. John Resig’s got the slides, so as soon as he posts them I’m sure we’ll find a way to synchronize them to this audio.

Painfully Obvious was built with WordPress, Prototype, Slicehost, and other accoutrements. Colophon →