Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

416 items tagged “javascript”

Lou’s Pseudo 3d Page. Spectacularly detailed exploration of the road graphics used in racing games prior to true 3D. This is a potential gold mine for anyone looking for a fun project to try out with canvas. Bonus points for comet integration—I’m still looking forward to the first real-time multiplayer game in the browser using comet and canvas. 0 8th February 2010, 11:21 am

dogproxy. Another of my experiments with Node.js—this is a very simple HTTP proxy which addresses the dog pile effect (also known as the thundering herd) by watching out for multiple requests for a URL that is currently “in flight” and bundling them together. 6 3rd February 2010, 1:05 pm

Comet (long polling) for all browsers using ScriptCommunicator. More Comet from the Plurk team: 80 lines of dependency free JavaScript implementing long polling using script tags (hence working cross-domain) across IE6+, Firefox, WebKit and Opera. The clever bit is the code to detect loading errors. It doesn’t try to fix the infinite loading indicator problem—is that still a cromulent usability concern? 0 3rd February 2010, 12:37 am

Plurk: Instant conversations using Comet (via) Plurk’s comet implementation sounds pretty amazing. They’re using a single quad-core server with 32GB of RAM running 8 Node.js instances to serve long-polled comet to 100,000+ simultaneous users. They switched to Node from Java JBoss/Netty and found the new solution used 10 times less memory. 0 1st February 2010, 10:13 am

jQuery source viewer. A neat way of browsing the source code of jQuery itself, complete with hyperlinks to other jQuery methods. Kind of a single-purpose IDE. I can see myself using this a lot. 0 1st February 2010, 10:01 am

HTML 5 audio player demo. Scott Andrew’s experiments with the HTML5 audio element (and jQuery)—straight forward and works a treat in Safari, but Firefox doesn’t support MP3. Presumably it’s not too hard to set up a fallback for Ogg. 0 1st February 2010, 9:58 am

Hot Code Loading in Node.js. Blaine Cook’s patch for Node.js that enables Erlang-style hot code loading, so you can switch out your application logic without restarting the server or affecting existing requests. This could make deploying new versions of Node applications trivial. I’d love to see a Node hosting service that allows you to simply upload a script file and have it execute on the Web. 0 31st January 2010, 1:57 pm

Dojo 1.4.1 vs jQuery 1.4.2pre on Taskspeed. John Resig’s reponse. When JavaScript libraries compete on performance, everybody wins. 0 29th January 2010, 2:19 pm

Dojo: Still Twice As Fast When It Matters Most. Alex Russell shows how Dojo out-performs jQuery on the TaskSpeed benchmark, which attempts to represent common tasks in real-world applications and has had code that have been optimised by the development teams behind each of the libraries. 1 28th January 2010, 10:40 pm

jQuery 1.4 Released. With comprehensive release notes. Huge performance improvements and a ton of very sensible enhancements to the API—far too many to summarise. 0 14th January 2010, 10:37 pm

qTip. Advanced tooltip plugin for jQuery, including borders and pointers created using CSS. Very flexible (we used this for the latest MP expenses application) but a little on the heavy side, weighing in at 38KB when minified. 2 30th December 2009, 6:23 pm

tipsy. Simple Facebook-style tooltip plugin for jQuery. 0 30th December 2009, 6:21 pm

Orderly JSON. Essentially the JSON equivalent of RelaxNG’s compact syntax—a pleasant mini-language for describing JSON objects which compiles to the more verbose JSONSchema format. 0 23rd December 2009, 2:44 pm

jQuery.require() implementation. John Resig has added a new jQuery.require() function to a jQuery development branch, for release as part of jQuery 1.4. The commit on GitHub has an extensive discussion attached to it (scroll to the bottom). 0 17th December 2009, 11:24 am

getElementsByTagName(). Dean Edwards rolls a hand-rolled getElementsByTagName function for use with DOM fragments (which don’t provide the method). His code is a nice example of a tightly written tree walker using the low level DOM API. 0 17th December 2009, 7:46 am

Real time online activity monitor example with node.js and WebSocket. A neat exploration of Node.js—first hooking a “tail -f” process up to an HTTP push stream, then combining that with HTML 5 WebSockets to achieve reliable streaming. 0 8th December 2009, 11:07 pm

jQuery 1.4 Alpha 1 Released. Impressively the new version contains no new features at all (correct me if I’m wrong), instead focusing on significant performance improvements to the existing API. 1 5th December 2009, 5:31 pm

Google Analytics goes async. This is excellent news—the latest version of the Google Analytics JavaScript is designed to allow for asynchronous loading, so it won’t hold up the rendering of your page. Analytics and banner ads are the two worst offenders when it comes to slowing down page loads. Now if only a banner ad vendor would follow suit... 1 2nd December 2009, 6:30 pm

flXHR. I was looking for something like this recently, glad to see it exists. flXHR is a drop-in replacement for regular XMLHttpRequest which uses an invisible Flash shim to allow cross-domain calls to be made, taking advantage of the Flash crossdomain.xml security model. 3 26th November 2009, 12:52 pm

LABjs: new hotness for script loading. Created in collaboration with Steve Souders, LABjs is a JavaScript loading library which makes it easy to have scripts download in parallel while still ensuring that they execute sequentially where required to ensure dependencies are met. It’s unclear how you would decide to use this over concatenating all scripts together in to a single file. 4 26th November 2009, 12:28 pm

Request Routing With URI Templates in Node.JS. I quite like this approach (though the implementation is a bit “this” heavy for my taste). JavaScript has no equivalent to Python’s raw strings, so regular expression based routing ala Django ends up being a bit uglier in JavaScript. URI template syntax is more appealing. 0 24th November 2009, 9:06 am

Node.js is genuinely exciting

I gave a talk on Friday at Full Frontal, a new one day JavaScript conference in my home town of Brighton. I ended up throwing away my intended topic (JSONP, APIs and cross-domain security) three days before the event in favour of a technology which first crossed my radar less than two weeks ago. [... 2009 words]

Deep Tracing of Internet Explorer. dynaTrace Ajax looks like an awesome tool. For once, Internet Explorer has a development tool that other browsers can be jealous of. 2 18th November 2009, 8:06 am

node.js at JSConf.eu (PDF). node.js creator Ryan Dahl’s presentation at this year’s JSConf.eu. The principle philosophy is that I/O in web applications should be asynchronous—for everything. No blocking for database calls, no blocking for filesystem access. JavaScript is a mainstream programming language with a culture of callback APIs (thanks to the DOM) and is hence ideally suited to building asynchronous frameworks. 0 17th November 2009, 6:07 pm

Going evented with Node.js. Comprehensive Node.js tutorial—from basic principles to installation and writing a simple Twitter search command-line client application. 0 17th November 2009, 1:09 pm

node.js. “Evented I/O for V8 JavaScript”—a JavaScript environment built on top of the super-fast V8 engine which provides event-based IO functionality for building highly concurrent TCP and HTTP servers. The API design is superb—everything is achieved using JavaScript events and callbacks (even regular file IO) and the small standard library ships with comprehensive support for HTTP and DNS. Overall it’s very similar to Twisted and friends, but JavaScript’s anonymous function syntax feels more natural than the Python equivalent. It compiles cleanly on Snow Leopard. Definitely a project to watch. 0 9th November 2009, 11:25 pm

It’s interesting to me how much [Closure] feels like a more advanced version of Dojo in many ways. There’s a familiar package system, the widgets are significantly more mature, and Julie and Ojan’s Editor component rocks. The APIs will feel familiar (if verbose) to Dojo users, the class hierarchies seem natural, and Closure even uses Acme, the Dojo CSS selector engine.

Alex Russell 0 6th November 2009, 7:35 am

Introducing Closure Tools. Google have released the pure-JavaScript library, apparently used for Gmail, Google Docs and Google Maps. It comes with a powerful JavaScript optimiser tool with linting built in and an accompanying Firebug extension to ensure the obfuscated code it produces can still be debugged. There’s also a template system which precompiles down to JavaScript and can also be called from Java. 1 6th November 2009, 7:33 am

Introducing the YUI 3 Gallery. Write a plugin for YUI3, BSD license it and sign a CLA and Yahoo! will push your module out to their CDN and make it loadable using the YUI().use() statement. They’re coordinating the submissions using GitHub. 0 4th November 2009, 11:14 pm

JSLitmus. “A lightweight tool for creating ad-hoc JavaScript benchmark tests”. Includes an ingenious hack for graphing the results—it generates a Google Chart, then provides a TinyURL for viewing that chart in the future. The TinyURL is generated by pointing an inconspicuous iframe at the TinyURL API and letting the user copy-and-paste the resulting shortened URL directly out of the iframe. 0 28th October 2009, 5:11 pm

Underscore.js. A new library of functional programming primitives for JavaScript—each, map, all, any, inject, detect etc. Unlike some similar libraries this one doesn’t extend the built-in objects, instead opting to bind the new functions to the underscore symbol. A jQuery-style noConflict() option is available if even that is too much namespace pollution for you. 0 28th October 2009, 5:08 pm

Introducing BERT and BERT-RPC. Justification for inventing a brand new serialisation protocol: Thrift and Protocol Buffers both use IDLs and code generation, XML “is not convertible to a simple unambiguous data structure in any language I’ve ever used” and JSON lacks support for unencoded binary data. The result is BERT—Binary ERlang Term—which extracts a format from Erlang in much the same way that JSON extracted one from JavaScript. 0 21st October 2009, 10:11 pm

Official Google Webmaster Blog: A proposal for making AJAX crawlable. It’s horrible! The Google crawler would map url#!state to url?_escaped_fragment_=state, then expect your site to provide rendered HTML that reflects that state (they even go as far as to suggest running a headless browser within your web server to do this). Just stick to progressive enhancement instead, it’s far less hideous. It looks like the proposal may have originated with the GWT team. 2 8th October 2009, 5:52 pm

breaking links. Mike complains about sites such as Twitter and WordPress.com which mess around with Ajax and links and hence breaks the ability to command-click to open a new tab in Safari (and Chrome). I just realised that I’ve subconsciously retrained myself to right click and select “open in new tab” to avoid that exact issue. 11 8th October 2009, 8:26 am

YUI 3.0.0: First GA Release of YUI’s Next-Generation Codeline. YUI 3 has some very neat ideas—everything is dynamically loaded, so you start with a tiny bootstrap script and call YUI().use(’module-name’) to load just the code you need. Congratulations to the team. 2 29th September 2009, 11:38 pm

Gmail for Mobile: Reducing Startup Latency. Cheeky iPhone optimisation trick—parsing 200 KB of JavaScript takes an iPhone 2.2 device 2.6 seconds, so Gmail embeds code components in /* comments */ in a script tag and evals them on demand later on when the features are needed. 0 23rd September 2009, 10:29 pm

JavaScript cannot save you. Even if it could, you should not let it, for the price of this short-term salvation is the end of what you like about the web.

Alex Russell 0 19th August 2009, 11:33 am

On HTML 5 Drag and Drop. Francisco Tolmasky investigated HTML 5 drag and drop, which allows web apps to implement drag and drop between windows and between the browser and the desktop. He found a number of problems with the spec and proposes detailed solutions. 1 17th August 2009, 12:31 pm

Scriptlets—Quick web scripts (via) From the prolific Jeff Lindsay, a pastebin-style tool for short server-side scripts written in Python, JavaScript or PHP that executes them within a Google App Engine powered sandbox. The Java code that implements the service is available on GitHub. 1 13th August 2009, 1:51 pm

JSONP Memory Leak. Neil Fraser advocates iterating over and deleting every property on a JSONP script DOM node after you removeChild it from the DOM, to protect against memory leaks of “in excess of 15 MB per hour”. 2 28th July 2009, 12:46 pm

EtherPad. Outstanding implementation of an online real-time collaborative text editor—basically SubEthaEdit in your browser. I can see myself using this a lot. 4 24th July 2009, 12:35 am

Reverse HTTP Demo (via) This is a bit of a brain teaser—a web server running in JavaScript in your browser which uses long polling comet to respond to incoming HTTP requests channelled through a “Reverse HTTP” proxy. 1 21st July 2009, 3:54 pm

Announcing Alice and Wonderland. Continuing the RabbitMQ “stuff to do with rabbits” naming convention, Alice is a RESTful interface to RabbitMQ which exposes information about vhosts/queues/users/exchanges/etc as JSON. Wonderland is a web UI for RabbitMQ implemented as a pure Ajax application which calls Alice. 0 17th July 2009, 9:12 am

John Resig on Glow. John criticises Glow for reinventing the wheel—BBC insiders respond in the comments below. 0 8th July 2009, 7:24 pm

BBC: Glow (via) The BBC have released Glow, their jQuery-like JavaScript library developed in house over the past few years. It’s open source under the Apache license. 0 8th July 2009, 3:25 pm

Modernizr (via) Neat idea and an unobtrusive implementation: a JavaScript library that runs feature tests for various HTML5 features (canvas, box shadow, CSS transforms and so on) and adds classes to the HTML body element, allowing you to write CSS selectors that only apply if a feature is present. Detected features are exposed to JavaScript as boolean properties, e.g. Modernizer.multiplebgs. 0 2nd July 2009, 10:56 am

Firefox 3.5 for developers. It’s out today, and the feature list is huge. Highlights include HTML 5 drag ’n’ drop, audio and video elements, offline resources, downloadable fonts, text-shadow, CSS transforms with -moz-transform, localStorage, geolocation, web workers, trackpad swipe events, native JSON, cross-site HTTP requests, text API for canvas, defer attribute for the script element and TraceMonkey for better JS performance! 1 30th June 2009, 6:08 pm

Unimpressed by NodeIterator. John Resig, one of the most talented API designers I’ve ever come across, posts some well earned criticism of the document.createNodeIterator DOM traversal API. 1 19th June 2009, 9:53 pm

SWFUpload jQuery Plugin. Nice looking plugin around an invisible Flash shim that provides multiple file uploads and client-side progress indicators. 7 16th June 2009, 11:46 am

Opera Unite. Opera’s big announcement: a developer preview (“labs release”) of their new web-server-in-your-browser feature, Unite. Includes an Opera-hosted proxy to help break through your firewall. The web server can be customised using server-side JavaScript running in an Opera Widget. 1 16th June 2009, 11 am

Mapstraction API Sandbox. Andrew Turner’s new tool for exploring the Mapstraction JavaScript library, which provides a unified code interface to 12 different mapping services 0 7th June 2009, 11:41 am

TiddlyPocketBook. Paul Downey took Nat’s dinky pocketbooks CSS and combined it with TiddlyWiki to create a single page pocketbook editor. 0 28th May 2009, 1:24 am

JS-Placemaker—geolocate texts in JavaScript. Chris Heilmann exposed Placemaker to JavaScript (JSONP) using a YQL execute table. Try his examples—I’m impressed that “My name is Jack London, I live in Ontario” returns just Ontario, demonstrating that Placemaker’s NLP is pretty well tuned. 0 23rd May 2009, 12:36 am

python-spidermonkey. A Python to JavaScript bridge using Mozilla Spidermonkey. Expose Python objects to JavaScript, or execute JavaScript from Python. 0 14th May 2009, 3:56 pm

Why I don’t love JavaScript’s Module Pattern. Jonathan Snook points out that the module pattern (where private functionality is hidden in a closure and only public methods are revealed to outside scopes) makes code a lot harder to debug. I use the module pattern for pretty much everything, not because I want to keep stuff private but more to avoid any chance of leaking out in to the global namespace. If I need to debug a value I temporarily assign it as a property on the global window object. 2 30th April 2009, 7:59 pm

Coupling asynchronous scripts. More from Steve Souders, this time discussing methods to cause externally loaded scripts to execute in the correct order, obeying dependencies. Surprisingly there’s no mention of YUI loader or the Dojo packaging system. 1 30th April 2009, 7:57 pm

Loading Scripts Without Blocking. Steve Souders is publishing extracts from his new book, “Even Faster Web Sites”. Here’s a systematic study of different JavaScript loading methods, along with a decision tree for picking the most appropriate one for your application. 0 30th April 2009, 7:56 pm

Building a Better JavaScript Profiler with WebKit. Clever hack from Francisco Tolmasky which solves the problem of JavaScript profilers showing ? as the name of any anonymous functions. He patched the WebKit profiler to look for a displayName attribute on a function and show that as the function name instead. 0 29th April 2009, 11:57 pm

With YQL Execute, the Internet becomes your database. This is nuts (in a good way). Yahoo!’s intriguing universal SQL-style XML/JSONP web service interface now supports JavaScript as a kind of stored procedure language, meaning you can use JavaScript and E4X to screen-scrape web pages, then query the results with YQL. 1 29th April 2009, 10:50 pm

And Now For Something Entire... Oooh! Shiny! Alex Russell on O3D, the new 3D browser plugin from Google that makes OpenGL accessible to JavaScript (and embeds V8 so performance won’t suck even on slower browsers). 0 22nd April 2009, 12:19 pm

Running Rhino and Helma NG on Google App Engine. Helma NG is a JavaScript web app framework, which now works on App Engine out of the box. 1 12th April 2009, 12:52 pm

Browsing my browsing. Roo Reynolds used the MeeTimer Firefox extension to gather statistics on his browsing habits, then extracted data directly from the SQLite database and generated his own graphs using PHP and the canvas element. 0 10th April 2009, 8:48 am

Protovis. JavaScript graphing library based on canvas, with an elegant chaining style API. 1 10th April 2009, 8:43 am

cufon. A promising alternative to sIFR, cufon uses VML on IE and canvas on other browsers to render custom fonts in the browser. You have to convert your font to JavaScript first, either using their free hosted tool or by installing the FontForge based server-side script yourself. The JavaScript encoded font file uses VML primitives to improve IE performance; the JavaScript library converts that to canvas calls for other, faster browsers. 7 6th April 2009, 10:29 pm

Ext Core 3.0 Beta Released. The Ext JavaScript team have just released the core library (similar to jQuery or Prototype) under an MIT license. The rich GUI elements that go on top are still under the GPL. 0 5th April 2009, 8:17 pm

Dojo 1.3 now available. Looks like an excellent release. dojo.create is particularly nice—I’d be interested to know why something similar has never shipped with jQuery (presumably there’s a reason) as it feels a lot more elegant than gluing together an HTML-style string. Also interesting: you can swap between Dojo’s Acme selector engine and John Resig’s sizzle. 5 1st April 2009, 12:19 am

Special Events in jQuery. How to add a custom “tripleclick” event to jQuery, using the jQuery.event.special extension hook. 0 30th March 2009, 10:15 am

Building Fast Client-side Searches. Flickr now lazily loads your entire contact list in to memory for auto-completion. Extensive benchmarking found that a control character delimited string was the fastest option for shipping thousands of contacts around as quickly as possible. 0 19th March 2009, 3:35 pm

A few notes on the Guardian Open Platform

This morning we launched the Guardian Open Platform at a well attended event in our new offices in Kings Place. This is one of the main projects I’ve been helping out with since joining the Guardian last year, and it’s fantastic to finally have it out in the open. [... 839 words]

Combine JSONP and jQuery to quickly build powerful mashups. jQuery’s JSONP support is one of my favourite little-known features of the library. 1 3rd March 2009, 3:17 pm

jQuery Sparklines. Delightful Sparklines implementation, using canvas or VML in IE. A neat nod towards unobtrusiveness as well: you can specify your data as comma separated values inside a span, then use a single jQuery method call to convert the span in to a sparkline image. 1 27th February 2009, 8:43 pm

Magic properties make Firefox synchronously load the Java plugin. Even defining a function called sun() (or several other symbols) will trigger the Java VM to be loaded, dramatically hurting the performance of your page. 0 27th February 2009, 4:03 pm

Accessibility and Degradation in Cappuccino. Ross Boucher from 280 North responds to Drew McLellan. 0 26th February 2009, 9:39 pm

The Cost of Accessibility. Drew McLellan comments on the seemingly inevitable march towards JavaScript dependent applications, and argues that JavaScript frameworks such as Cappuccino have a duty to integrate accessibility in to their core. 3 25th February 2009, 10:31 pm

Oscars 2009: the interactive results | guardian.co.uk. My latest project for the Guardian, put together on very short notice. Updates live as the results are announced, and allows Twitter users to vote on their favourite for each category by sending a specially formatted message to @guardianfilm—jQuery and Ajax polling against S3 under the hood. 0 23rd February 2009, 2:19 am

I think you overstate the usefulness of the [jQuery Rules] plugin. Using this plugin, users are now limited by what selectors that can use (they can only use what the browsers provide—and are at the mercy of the cross-browser bugs that are there) which is a huge problem. Not to mention that it encourages the un-separation of markup/css/js.

John Resig 1 22nd February 2009, 11:11 pm

jQuery.Rule (via) jQuery plugin for manipulating stylesheet rules. For me, this is the single most important piece of functionality currently missing from the core jQuery API. The ability to add new CSS rules makes an excellent complement to the .live() method added in jQuery 1.3. 10 22nd February 2009, 5:53 pm

jQuery 1.3.2 release notes. Not just a bug fix—there are a number of subtle behaviour changes, including to the :visible/:hidden selectors and the appendTo/prependTo/*To family of methods. I strongly recommend testing and reviewing those changes before upgrading. 1 21st February 2009, 4:42 pm

Twitter Don’t Click Exploit. Someone ran a successful ClickJacking exploit against Twitter users, using a transparent iframe holding the Twitter homepage with a status message fed in by a query string parameter. Thiss will definitely help raise awareness of ClickJacking! Twitter has now added framebusting JavaScript to prevent the exploit. 6 12th February 2009, 7:56 pm

Ehy IE8, I Can Has Some Clickjacking Protection? (via) IE8 has built-in protection against clickjacking, but it’s opt-in (with a custom HTTP header) and IE only. It turns out the usual defence against clickjacking (using framebusting JavaScript) doesn’t work in IE as it can be worked around with a security=“restricted” attribute on an iframe. 0 29th January 2009, 1:39 pm

OCR and Neural Nets in JavaScript. John dissects the brilliant Greasemonkey script that solves simple captchas using the canvas element and HTML5’s getImageData API. 0 25th January 2009, 12 am

google-mobwrite. Neal Fraser’s terrifyingly clever differential synchronization algorithm (for SubEthaEdit-style collaboration over the web) is now available as an open source Python and JavaScript library. 2 24th January 2009, 11:55 pm

AJAX APIs Playground. Ferociously useful collection of executable and editable example code for all(?) of Google’s JavaScript APIs, including Google Maps and the increasingly interesting Visualization API. 0 22nd January 2009, 6:38 pm

jQuery 1.3.1 Released. Bug fix for 1.3, mainly browser compatibility issues. Of interest: jQuery no longer ship a packed version (where JS is used to further decompress a string), as their tests show that this reduces performance due to the overhead of the extra decompression. They still provide a YUI Compressor minified version. 0 22nd January 2009, 10:41 am

jQuery 1.3 and the jQuery Foundation. The IP for jQuery and jQuery UI now rests with the Software Freedom Conservancy (a smart alternative to setting up a brand new foundation), while Sizzle is a separate project looked after by the Dojo Foundation. 0 14th January 2009, 5:59 pm

Sloppy—the slow proxy. Java Web Start GUI application which runs a proxy to the site of your choice simulating lower connection speeds—great for testing how well your ajax holds up under poor network conditions. 2 13th January 2009, 4:17 pm

Visualising Radio, pushing, not pulling. The BBC’s new radio player uses Comet over a Flash XMLsocket connection transport, with an ActiveMQ message queue behind the scenes. I’d like to know what server they’re using to broadcast out to the XMLsocket connections. 4 13th January 2009, 12:59 am

A Snapshot of The Yahoo! Photos Beta (from 2006). Scott Schiller shares an internal retrospective on the Yahoo! Photos interface from 2006, which was years ahead of its time (they started building it before the term Ajax had even been coined). The material on memory management and event delegation is particularly interesting. 0 12th January 2009, 10:21 pm

instanceof considered harmful (or how to write a robust isArray. JavaScript’s instanceof operator breaks when dealing with objects that may have been created in a different document or frame, since constructors are unique to each frame. Instead, you can check for arrays using the default Object.toString method which the JS spec guarantees will return [object Array]. 0 12th January 2009, 10:55 am

Manage Amazon EC2 With New Web-Based AWS Management Console. Finally! I’m amazed it took Amazon so long to do this. Managing EC2 instances from a custom Firefox extension was pretty bizarre. It’s a very nice interface, built on top of YUI. Unfortunately you still have to manage your entire virtual server farm using a single shared Amazon account. 1 9th January 2009, 9:34 am

ReferenceError: console is not defined. Since Firebug 1.2 you need to call window.loadFirebugConsole() in order for console.log and friends to work. 2 23rd December 2008, 10:22 pm

Quickchoice—a Speed Dial clone (via) Lovely demonstration of the CSS transform property, as supported by modern browsers. The magic is all in the “iframe { transform: scale(0.25, 0.25) translate(-1200px, -900px) }”. 1 23rd December 2008, 12:49 pm

jQuery: Changeset 5990. “Added a new liveQuery/event delegation hybrid method”. Lets you add events that continue to work as new elements are dynamically appended to the DOM, e.g. $(’div p.foo’).live(’click’, fn). Works by adding an event handler to the root document element itself and relying on event bubbling. I have to admit I preferred the earlier proposal of $(’div’).delegate(’p.foo’..), which feels like it should have much better performance—anyone know of a good plugin that supports this? 3 23rd December 2008, 12:22 pm

jQuery changeset 5985 (via) jQuery trunk has ditched browser sniffing in favour of feature testing, where a small suite of unit-test-like code blocks is used to detect whether a browser supports specific idioms. If the tests fail jQuery still makes assumptions about what the fix is, but it’s not hard to imagine the library eventually using code tests to ensure the fix will work as well. 0 22nd December 2008, 10:58 am

Someone asked for onbeforeunload, so I started fixing it. Then I found that there was some rot in the drywall. So I took down the drywall. Then I found a rat infestation. So I killed all the rats. Then I found that the reason for the rot was a slow leak in the plumbing. So I tried fixing the plumbing, but it turned out the whole building used lead pipes. So I had to redo all the plumbing. But then I found that the town’s water system wasn’t quite compatible with modern plumbing techniques, and I had to dig up the entire town. And that’s basically it.

Ian Hickson 0 19th December 2008, 1:58 pm

Integrating Facebook Connect with Django in 15 minutes. Django authentication middleware that calls the Facebook REST API using a cookie set by Facebook Connect and checks if that person is your Facebook friend. Despite most of the magic happening on the server you still need Facebook’s JavaScript to set that cookie in the first place. 1 17th December 2008, 1:18 pm

husk.org. a flickr machine tag browser (via) Flickr recently added API methods for exploring the machine tags used by the community. Paul Mison has built a neat OS X Finder style interface for exploring them, using JSONP and jQuery. 0 15th December 2008, 11:24 pm

Visual Event. External code loading bookmarklet that visualises the JavaScript events hooked up to the current page, and lets you view the source code of the event handling function for each one. Only works for events added by jQuery, YUI or MooTools since those libraries maintain a cache of event handlers that they add, to work around the standard DOM’s omission of handler introspection. 3 10th December 2008, 3:38 pm

Internet explorer mystery #1376. IE executes function definitions inside an “if (0)” block. That frightens me. 5 3rd December 2008, 9:04 am

lightningtimer.net. I’m fed up of having to dig out or knock up a timer script every time I manage lightning talks, so I’ve given one a domain name. You can use lightningtimer.net/#90 to set a different start time for the counter. 9 12th November 2008, 4:43 pm

Introducing Acre. I’m losing track of all the server-side JavaScript hosted web application platforms now. Here’s the Freebase contribution to the genre, complete with IDE, templating language and strong integration with Freebase itself. 2 7th November 2008, 11:23 pm

jQuery history plugin. I used this plugin to add back button support to a small Ajax app today, with great results. I tried it a while ago and it didn’t work in Safari, but someone has updated it since and now it works perfectly. 2 7th November 2008, 5:32 pm

Yahoo, Caja, OpenSocial. Yahoo!’s new application platform uses OpenSocial, and protects itself from malicious JavaScript using Google’s Caja secure JavaScript engine. I hadn’t realised that Caja was ready for production use—this is excellent news. 0 30th October 2008, 5:14 pm

JSSpeccy. A ZX Spectrum emulator written in Javascript. 0 29th October 2008, 5:25 pm

I’m really typecasting myself here. If there were an international “Person most likely to write a Spectrum emulator in Javascript” award, I’d have taken it for the last five years running.

Matt Westcott 0 29th October 2008, 5:24 pm

typeface.js. Outstanding hack—renders custom fonts using VML in IE and canvas in everything else, using fonts that are defined as a set of vector paths stored using JSON. 5 27th October 2008, 11:45 pm

Freebase Hack Day. I’m finding Freebase increasingly interesting at the moment, and their public hack day on the 8th November in San Francisco looks like it could be a lot of fun. They’ll be previewing Acre, a new server-side JavaScript application platform targeted at building Freebase powered applications. Hit “view source” at the bottom of the hack day site to see what an Acre app looks like. 0 24th October 2008, 12:06 am

CSSHttpRequest (via) Devious cross-domain Ajax hack that uses CSS for transport (@import rules with data URIs, but it still works in IE). Similar to JSONP but safer, since JSONP can cause arbitrary JavaScript to execute. 5 23rd October 2008, 6:25 pm

FriendFeed launch a real-time API. This is huge: JSONP plus long polling Comet, with “everything since X” tokens to ensure you don’t miss anything. This is the first open Comet API I’ve seen anywhere. Combine this with FriendFeed’s regular API (which allows arbitrary message posting) and you’ve got a really powerful tool for hackers who want to experiment with Comet without rigging up their own infrastructure. 1 22nd October 2008, 2:18 pm

Private Messages with cometD Chat. cometd-java (a Java servlet reference implementation of the Bayeux protocol) can be extended with BayeuxService subclasses that run within the server itself. 0 16th October 2008, 2:14 pm

Page Inlink Analyzer (via) Here’s why I’m so keen on JSONP APIs—Eric Miraglia’s tool fires off dozens of cross-domain JSON requests to pull together information about inbound links to your site from Yahoo! Site Explorer and del.icio.us. I imagine it would have been uneconomic for him to provide the tool if it had to proxy every request through his own server. 0 15th October 2008, 5:23 pm

Browser Paint Events. The latest Firefox nightlies include a new MozAfterPaint event which fires after a portion of the page has been redrawn and provides co-ordinates of the affected rectangle. John Resig provides a neat bookmarklet that uses the new event to visualise repainting operations. 0 14th October 2008, 1:08 pm

Antisocial. Matt Westcott (a.k.a. Gasman) provides some technical background to his awesome Antisocial 3D canvas demo. 0 9th October 2008, 6:42 pm

Antisocial: a Javascript demo by Gasman. The demo is cool (3D on top of canvas); the “demotool” editor is simply amazing. 0 8th October 2008, 3 pm

Dealing with UI redress vulnerabilities inherent to the current web (via) The best explanation of clickjacking I’ve seen yet, complete with discussion of a number of non-ideal potential solutions. It looks like frame busting JavaScript will defeat it, but only for users who have JavaScript enabled—which means that in this case extensions like NoScript actually make you less safe. UPDATE: NoScript is smarter than I thought; see the comments. 6 7th October 2008, 9:59 am

Tweetersation. Nat and my latest side project: a JSONP API powered tool to more easily follow conversations between people on Twitter, by combining their tweets in to a single timeline. 6 2nd October 2008, 5:08 pm

Google’s Wikipedia and Panoramio layers are now available in the API. I really like their use of reverse domain style identifiers for the layer IDs: map.addOverlay(new GLayer(“org.wikipedia”)); 0 2nd October 2008, 11:59 am

freebase-suggest (via) A jQuery plugin that performs auto-completion against the Freebase JSONP API, and allows the results to be limited to specific categories or subsets. 0 24th September 2008, 11:58 pm

Secure mashups with dojox.secure (via) dojox.secure is brilliant and terrifying at the same time. It provides a full featured API for running untrusted JavaScript in a sandbox, by parsing and validating that code against a variant of Douglas Crockford’s ADsafe JavaScript subset. It could be fantastically useful, but it’s difficult to judge how secure this approach really is. 1 24th September 2008, 4:08 pm

When Ajax Attacks! Web application security fundamentals. Slides and notes from my talk on web application security at @media Ajax last Tuesday. 0 20th September 2008, 4:16 pm

Frame-Busting Gadgets. I’ve always been slightly suspicious of the Google Gadgets / OpenSocial idea of sandboxing untrusted third party content in an iframe. Sure enough, it turns out iframe busting scripts work in Gadgets, meaning a seemingly harmless gadget could potentially launch a phishing attack. 0 17th September 2008, 11:23 pm

Gearshift. Whoa, a full migrations library written in JavaScript for Gears (which uses SQLite for its data store). 0 15th September 2008, 2:51 pm

Prototype based programming in python. Neat implementation of JavaScript-style prototype inheritance in Python. 1 11th September 2008, 5:50 pm

Dromaeo: JavaScript Performance Testing (via) This is one classy benchmark. Run it in as many browsers as you like (each run is saved to the server and assigned a run ID), then compare the results by appending ?id=[run1],[run2]... to the URL. 2 11th September 2008, 4:06 pm

Cappuccino Web Framework. Now open source (LGPL)—the Objective-C-in-JavaScript web application toolkit from 280 North, who are speaking at this year’s FOWA in October. Beautiful logo. 3 5th September 2008, 3:27 pm

V8 Design Elements. High level design details of Google’s V8 JavaScript engine, including how it uses “hidden classes” to optimise object property lookups and a bit of information on the machine code generation and garbage collection. 1 2nd September 2008, 11:58 pm

Chromium. Google Chrome is out! Here’s the open source project, including the code for the new V8 JavaScript virtual machine. 0 2nd September 2008, 9:06 pm

Google Chrome, the comic book (via) Google have finally announced a browser project, though it’s currently vapourware (or rather comicware), existing only as a Scott McCloud comic. Still, it looks fascinating—entirely open source, WebKit with a brand new JavaScript VM, every tab running in a separate process for smarter memory usage and some new UI concepts and anti-pishing measures thrown in as well. 12 1st September 2008, 7:45 pm

addSizes.js: Snazzy automatic link file-size generation. Posted to Nat’s snazzy new blog: a script that uses my json-head API to grab the file size of linked documents on a page and insert those sizes in to the document. 3 30th August 2008, 10:39 am

WolfenFlickr 3D—An unlikely mashup. Brilliant: Wolfenstein 3D style raycasting in JavaScript with images on the walls that have been pulled in using Flickr’s JSONP API. 0 29th August 2008, 10:24 am

Coding Horror: Protecting Your Cookies: HttpOnly. Jeff Atwood discovers the hard way that writing an HTML sanitizer is significantly harder than you would think. HttpOnly cookies aren’t the solution though: they’re potentially useful as part of a defense in depth strategy, but fundamentally if you have an XSS hole you’re going to get 0wned, HttpOnly cookies or not. Auto-escape everything on output and be extremely cautious with things like HTML sanitizers. 0 29th August 2008, 2:01 am

Capital Radio’s London Guide. Worth pointing out: the search / map interface on this page is one of the best examples of progressive enhancement I’ve ever seen. Try disabling JavaScript and see what happens. It seems like most developers just can’t be bothered with this kind of attention to detail these days, which disappoints me. 4 29th August 2008, 1:48 am

json-tinyurl. Because sometimes you want to be able to create a shorter version of a URL directly from JavaScript without hosting your own server-side proxy. 0 27th August 2008, 10:58 am

jeresig’s sizzle. Sizzle is a new selector engine (work in progress, no IE support yet) from John Resig, designed to be small, standalone, library agnostic and ridiculously fast. It should eventually replace jQuery’s current selector engine, but if it stays around 4KB it’s also going to be really useful for projects that don’t need the overhead of a full library. 0 24th August 2008, 11:41 pm

TraceMonkey. Brendan Eich has been preaching the performance benefits of tracing and JIT for JavaScript on the conference circuit for at least a year, and the results from the first effort to be merged in to Mozilla core are indeed pretty astounding. 0 22nd August 2008, 11:13 pm

Get Lat Lon now has a “Get my location (by IP)” button. It took all of five minutes to add using the new google.loader.ClientLocation API. The button is only visible if your location can be resolved. 3 22nd August 2008, 10:16 am

Gears API Blog: Gears 0.4 is here! New features are Geolocation, a Blob API for dealing with arbitrary binary data, onprogress() events for tracking HTTP downloads and uploads (meaning progress indicators) and the built-in Gears dialogs localized to 40 languages. 0 22nd August 2008, 10:14 am

Google Code Blog: Two new ways to location-enable your web apps. The Gears Geolocation API isn’t very exciting just yet as it only really works on windows mobile devices, but the new google.loader.ClientLocation Ajax API is great—it gives you the user’s location based on looking up their IP address, saving you from needing to install a IP-to-geo lookup database. 0 22nd August 2008, 10:12 am

Making queries faster isn’t in the critical path for improving the real-world performance of any Dojo apps I know of, and I bet the same is true for JQuery users. Reducing the size of the libraries, on the other hand, is still important. Now that we’re all fast enough, it’s time that we stopped beating on this particular drum lest we lose the plot and the JavaScript community continue to subject itself to endless rounds of benchmarketing.

Alex Russell 0 22nd August 2008, 8:12 am

querySelectorAll in Firefox 3.1. John Resig benchmarks the various JavaScript libraries’ support for querySelelectorAll, and finds an impressive 2-6x performance improvement over native DOM traversal. It’s worth clicking through to John’s experimental plugin for adding support to jQuery, which does a clever trick using __proto__ to convert the collection returned by querySelectorAll in to a jQuery object in browsers that support it. 0 21st August 2008, 9:50 am

YUI 3.0 Preview Release 1. YUI sandboxing is a really good idea, which cleverly addresses both the need to run multiple versions of the library at once and the complaints about how verbose traditional YUI code can get. 0 14th August 2008, 10:03 am

ECMAScript Harmony. John Resig explains the outcome of the recent “Oslo meeting” where proponents of ECMAScript 3.1 (incremental improvements to JS as it exists today) and 4 (massive, sweeping changes including many new programming constructs) harmonised their differences. The combined effort is closer to 3.1 than it is to 4, which I think is the right decision. 0 14th August 2008, 9:37 am

MapIconMaker. Extension API that lets you programatically construct a Google Maps bubble marker icon with a custom size, gradient and stroke colour. Under the hood it uses the Google Chart API with the (undocumented?) “mm” chart type. 0 11th August 2008, 8:48 am

Facelift Image Replacement. Like sIFR but with JavaScript and a PHP text rendering component. I question the need for the JavaScript if you’re already generating the images on the server, but the actual generation script is nicely done—it makes smart use of ImageMagick and caches the generated images. 3 5th August 2008, 6:36 pm

How Comet Brings Instant Messaging to meebo. “What started off as a hack appears to be fulfilling one of the most basic needs of the Web, which is live synchronous interaction”—Jian Shen 0 27th July 2008, 11:18 am

Firebug Lite 1.2 (via) Huge upgrade to the IE/Opera/Safari bookmarklet version of Firebug—it now has DOM element inspection, XHR tracking and an interactive console, among other features. 0 27th July 2008, 9:30 am

Dojango version 0.3 released. A reusable Django application that provides Dojo, helper functions (dojo.data integration) and tools for switching between Dojo versions. 1 24th July 2008, 12:47 am

window.name Transport. The cleverest use of the window.name messaging hack I’ve seen yet: Dojo now has dojox.io.windowName.send for safe, performant cross-domain messaging. 2 23rd July 2008, 4:25 pm

php: rfc: closures (via) I never thought I’d see the day, but a patch adding closures to PHP has been both proposed and accepted! Looks like a solid implementation—the syntax is similar to JavaScript but makes explicit which variables are to be captured. As with much of PHP, values are copied in to the closure by default but you can use an ampersand to specify JavaScript-style pass-by-reference instead. 2 19th July 2008, 10:58 pm

quipt (via) Extremely clever idea: Cache JavaScript in window.name (which persists between page views and can hold several MB of data), but use document.referrer to check that an external domain hasn’t loaded the cache with malicious code for an XSS attack. UPDATE: Jesse Ruderman points out a fatal flaw in the comments. 3 4th July 2008, 3:49 pm

A browser sniffing warning: The trouble with Acid3 and TinyMCE. Opera recommend “bug detection”, a step up from object detection and browser sniffing where your JavaScript includes mini unit test style fragments of code designed to test if buggy behaviour you are working around still affects the user’s browser. 0 4th July 2008, 8:24 am

eval() Kerfuffle. The ability to read supposedly private variables in Firefox using a second argument to eval() will be removed in Firefox 3.1. 0 2nd July 2008, 9:24 pm

Javascript protocol fuzz results. If your HTML sanitizer uses blacklisting rather than whitelisting here are a few more weird ways of injecting javascript: in to a link that you need to worry about—but you should really switch to whitelisting http:// and https:// instead. 2 30th June 2008, 3:57 pm

Module Pattern Provides No Privacy... at least not in JavaScript(TM) (via) JavaScript variables hidden inside a closure aren’t as hidden as I thought—it turns out you can pass a closure as the second argument to eval (at least in Firefox) and “steal” private variables back out of it. 2 27th June 2008, 7:01 pm

BUG: XSS Security flaw in BaseCamp Messages (via) BaseCamp lets users include HTML and JavaScript in messages, on the basis that anyone with a BaseCamp account is a trusted party. I’m not convinced: you could use this to circumvent BaseCamp’s access control stuff and read messages you’re not meant to. On the flip side, you could also use this to add brand new features to BaseCamp by using JavaScript in a message as a server-side equivalent to Greasemonkey. 1 26th June 2008, 9:39 am

jsontime. Nat and I threw this together this morning—it runs on Google App Engine and exposes Python’s pytz timezone library over JSONP. 13 21st June 2008, 7:07 pm

When Bugs Collide: Fixing Text Dimming in Firefox 2. Handy tips from Drew on fixing the glitchy text rendering in Firefox 2 when you animate opacity without breaking alpha-transparent PNGs in IE6. 0 19th June 2008, 6:09 pm

Deep Profiling jQuery Apps. Neat plugin from John Resig that monkey-patches most (all?) of the jQuery methods to build up a detailed profile of which methods are being used by a given page. 1 16th June 2008, 10:20 am

Spicing Up Embedded JavaScript. John Resig collects the various ways in which a JavaScript interpreter can be hosted by Python, PHP, Perl, Ruby and Java. There are full JS implementations in PHP, Perl and Java; Ruby and Python both have modules that use an embedded SpiderMonkey. 1 15th June 2008, 11:32 am

Is It OK to Require JavaScript? Not if you can avoid doing so. Unobtrusive JavaScript really isn’t hard if you design it in from the start, and since stackoverflow is a community forum / questions and answers site I have trouble imagining a feature that can’t be made to work without JavaScript. 8 10th June 2008, 6:41 am

OS OpenSpace from Ordnance Survey (via) Ordinance Survey now provide a free JavaScript mapping API for “non-commercial purposes” by “private individuals”. The maps look incredibly detailed, although I can’t find any live API demos on the site (the documentation is illustrated with screenshots). 3 9th June 2008, 8:30 am

Updated jQuery Bookmarklet. Nicer than my own “Inject jQuery” bookmarklet because it drops in a temporary message confirming that jQuery has been imported (or telling you that jQuery was already present). 0 8th June 2008, 8:46 pm

An interview with 280 North on Objective-J and Cappuccino. Fantastic comment thread with involvement from the guys who created Objective-J. Just like Objective-C, Objective-J is a preprocessor that runs against regular JavaScript source files so you can use JavaScript and Objective-J idioms interchangeably. 0 7th June 2008, 7:40 pm

280slides and Objective-J. 280 slides uses an Objective-C clone written in 13KB of JavaScript. I have to admit I’m completely baffled as to why you would want to use Objective C instead of JavaScript, but evidently it worked fantastically well for them. 2 7th June 2008, 4:09 pm

SquirrelFish. WebKit’s JavaScript engine was no slouch, but that hasn’t stopped them from replacing it with a brand new “register-based, direct-threaded, high-level bytecode engine, with a sliding register window calling convention”. It runs 1.6x faster and has the Best Logo Ever. 2 3rd June 2008, 7:57 am

Google Earth in a browser (sort of), Scriptable, a quick peek and poke. Dan Catt on Google’s new browser plugin version of Google Earth... which conveniently exposes a JavaScript API to the browser in the form of the “ge” object, which can then be poked at interactively using Firebug. 0 28th May 2008, 11:13 pm

QUnit. The jQuery unit testing framework is now documented and supported as a separate project. 0 26th May 2008, 5:31 pm

AOP aspect of JavaScript with Dojo. Fantastic post—concisely explains Aspect Oriented Programming, then shows how Dojo’s dojox.lang.aspect brings AOP to JavaScript, including some really useful built-in aspects for logging, profiling and more. Aspects are like Python decorators on steroids. 3 18th May 2008, 10:45 am

Dopplr place googlemaps, with and without Yahoo Geo API bounding box adjustment. Dopplr uses Geonames for most geo information, but is now mixing in bounding box data from the Yahoo! Geo web service to improve the default zoom level for their maps. The JSON callback API means no server-side code is required on Dopplr’s end. 0 17th May 2008, 11:35 pm

Firebug Command Line API. Another thing I didn’t know about Firebug: you can set a breakpoint at the start of a function with “debug(fn)” and log all calls to it with “monitor(fn)”. 0 16th May 2008, 12:14 pm

Cubescape. Beautiful isometric cube building tool by Cameron Adams, written in JavaScript and jQuery. 0 15th May 2008, 8:40 am

Crossdomain.xml Invites Cross-site Mayhem. A useful reminder that crossdomain.xml files should be treated with extreme caution. Allowing access from * makes it impossible to protect your site against CSRF attacks, and even allowing from a “circle of trust” of domains can be fatal if just one of those domains has an XSS hole. 0 15th May 2008, 8:06 am

Engineering @ Facebook: Facebook Chat. The new Facebook Chat uses Comet (long polling with a hidden iframe) against a custom web / chat server written in Erlang, designed to handle a launch to all 70 million users at once. It was tested using a “dark launch” period where live pages simulated chat request traffic without showing any visible UI. 0 15th May 2008, 7:55 am

goog/useragent/iphoto.js. The Goog library includes code to detect the user’s installed version of iPhoto, based on reverse engineering the Mac.com Gallery RSS feeds. This has Mark Pilgrim written all over it. 0 14th May 2008, 9:21 pm

Doctype: /trunk/goog. Google’s newly released JavaScript library (pure JavaScript, so more along the lines of YUI and jQuery than GWT). I haven’t found the documentation for it yet, but the code is extremely well commented. UPDATE: The documentation is spread throughout Doctype. 0 14th May 2008, 9:12 pm

Doctype on Google Code. Alternative way of browsing Google Doctype—if you link to articles here instead of using the permalinks in the official version non-JavaScript user agents will be able to access the content you’ve linked to. 0 14th May 2008, 8:34 pm

Google Maps now shows photos and Wikipedia articles. Click the “More...” button. My first thought was “how do they get so many photo markers on the map?”—Firebug shows that they’re generating tiles on the server containing multiple photo markers, then when you click on one an Ajax call checks which photo is in that particular spot. 0 14th May 2008, 7:10 pm

Session variables without cookies. Brilliant but terrifying hack—you can store up to 2 MB of data in window.name and it persists between multiple pages, even across domains. Doesn’t work with new tabs though, and storing JSON in it and eval()ing it is a bad idea—a malicious site could populate it before sending the user to you. 1 13th May 2008, 9:59 pm

Hey Google: any chance we can all build the social web together without requiring JavaScript?

Me 9 13th May 2008, 1:49 pm

Persevere adds Comet Support. Persevere sounds neat: a RESTful HTTP/JSON data store (the interface reminds me of CouchDB) which recently gained the ability to “subscribe” to a resource and receive notifications of updates via comet. 1 13th May 2008, 8:09 am

Processing.js. John Resig’s outstanding port of the Processing visualisation language to JavaScript and Canvas. Runs amazingly well in Firefox 3. One hell of a hack. 0 9th May 2008, 8:24 am

Unobtrusive JavaScript with jQuery. The online handout for the tutorial I gave this morning at XTech. 6 6th May 2008, 6:53 pm

Reading binary files using Ajax. There’s a simple trick for Firefox, and (amazingly) you can get IE to play along using a function written in VBScript. 0 22nd April 2008, 7:02 pm

Embedding custom non-visible data in HTML 5. “Every HTML element may have any number of attributes starting with the string ’data-’ specified, with any value.”—this will be incredibly useful for unobtrusive JavaScript where there’s no sensible place to store configuration data as HTML content. It will also mean Dojo has an approved method for adding custom attributes to declaratively instantiate Dojo widgets. 3 19th April 2008, 10:58 pm

JavaScript: The Good Parts. Douglas Crockford’s soon-to-be-published book on the subset of JavaScript that he recommends. Promises to be “short, but dense”—if it’s half as good as his JavaScript lectures this is going to be a must-have. 0 19th April 2008, 4:38 pm

Comet at the Highland Fling. I thoroughly enjoyed the Highland Fling yesterday. Here are the slides from my talk on Comet. 0 4th April 2008, 10:13 am

Implementing a syntax-higlighting JavaScript editor in JavaScript. Appropriately subtitled “a brutal odyssey to the dark side of the DOM tree”. Some seriously clever trickery going on here. 0 4th April 2008, 8:27 am

Advanced JavaScript Debugging Techniques. There’s more to JavaScript debugging than just Firebug. 0 4th April 2008, 7:51 am

Brendan Eich: Popularity. I never knew that Brendan went to Netscape on the promise of “doing Scheme in the browser”. 0 4th April 2008, 7:30 am

Classy Query. Beautifully implemented parody of class-based JavaScript and verbose namespacing as a jQuery extension, from John Resig. The source code has some neat tricks in it, in particular the buildClass() function. 0 1st April 2008, 9:48 am

getElementsByClassName pre Prototype 1.6. Older releases of Prototype break in Firefox 3 and Safari 3.1 due to unsafe namespace management—getElementsByClassName is now a browser built-in but with different semantics to the Prototype method of the same name. Prototype 1.6 is fine. 0 26th March 2008, 8:28 am

Firebug + Dijit tips. News to me: Firebug has a magic $1 variable which corresponds to the currently selected node. Very handy. 1 17th March 2008, 2:08 am

dojox.gfx demos. Impressive demos of the Dojo 2D drawing APIs—these need to be linked from the dojo site, it took me quite a while to find them. 0 16th March 2008, 4:24 pm

JavaScript in Internet Explorer 8. John Resig’s analysis. News to me: IE 8 doesn’t support the W3C event model—I had assumed that would be a priority. 1 6th March 2008, 11:59 pm

Internet Explorer 8 Readiness Toolkit. The new built-in development tools look similar enough to Firebug to make me very happy. Also of interest: Selectors API (for fast getElementsBySelector), CSS 2.1 support, support for XHTML style namespaces in HTML, an interesting Web Slices feature based on the hAtom microformat and 6 connections per host (up from 2) which should make Comet easier. 1 5th March 2008, 6:28 pm

Acid3 is out. The third Acid test, again compiled by Ian Hickson. This one viciously tests DOM Scripting standards compliance and currently exposes flaws in every browser. 0 5th March 2008, 12:34 am

CouchDB, XML, and E4X. Brilliant—CouchDB now enables SpiderMonkey’s E4X support, meaning CouchDB views can easily query XML documents stored inside JSON objects using E4X syntax. 0 5th March 2008, 12:31 am

Gears 0.2 Released! New modules are HttpRequest and Timer, both for use within workers (which provide Erlang-style message passing concurrency). Particularly interesting is that the Gears HttpRequest module can be used for much cleaner Comet implementations in IE. 0 5th March 2008, 12:21 am

xssinterface (via) Clever JavaScript library for implementing opt-in cross-domain messaging in JavaScript (allowing communication between pages and iframes on different domains). Uses HTML 5’s postMessage API if available, otherwise falls back on either Google Gears or a clever cookie hack. 0 5th March 2008, 12:08 am

Flickr Uploadr: Open Source and Powered by XULRunner. Quietly released a few months ago; it’s really nice. 1 13th February 2008, 11:30 pm

jQuery 1.2 Cheat Sheet. Handy. It helps that most of jQuery’s method names are pretty much self explanatory once you’ve been using the library for a couple of weeks. 2 10th February 2008, 9:12 pm

Event Delegation Made Easy. Dan Webb demonstrates a neat trick for event delegation in jQuery, using CSS selectors and the jQuery .is() method to dispatch to different callbacks from a single event handler based on the target of the event. 0 10th February 2008, 3:13 pm

Transitioning from Java Classes to JavaScript Prototypes. Peter Michaux shows how JavaScript’s prototypal inheritance can run rings around traditional Java-style classes once you figure out how to take advantage of it. 0 10th February 2008, 3:10 pm

Cross-Window Messaging. Now in Firefox 3 trunk, the HTML 5 specified ability for JavaScript to send messages between windows (or iframes) hosted on different domains. Fantastically powerful, but must be implemented with care to avoid accidentally processing bad messages from malicious third parties. 0 10th February 2008, 12 pm

querySelector and querySelectorAll. WebKit now supports the W3C Selectors API. Expect the various JavaScript libraries to add this as an optimisation to achieve massive speedups (Prototype are already working on it). 0 8th February 2008, 11:21 am

Low Pro For jQuery? Dan Webb on why he prefers Prototype over jQuery: “The one big reason was that, while jQuery was super simple and concise when working on smaller projects, it offered no help in structuring larger applications”. 0 3rd February 2008, 10:16 pm

Faster JavaScript Trim. Neat optimisation post—it turns out that while regular expressions are great for removing leading whitespace you can do a lot better at trailing whitespace by manually looping backwards from the end of the string. 3 3rd February 2008, 10:12 pm

Let me be again clear here that Comet isn’t a new single technique. Rather, it’s a combination of existing push technologies with further research into new methods that together provides a robust framework for pushing data to all clients on modern networks.

Michael Carter 0 3rd February 2008, 10:04 pm

Blob Sallad—canvas tag and JavaScript physics simulation experiment. Björn Lindberg provides a detailed code walkthrough of his brilliant canvas demo, inspired by Loco Rocco. 0 26th January 2008, 12:25 pm

jQuery.ScrollTo (via) Neat jQuery plugin for animated scrolling of both windows and overflow elements. 2 21st January 2008, 9:53 pm

Dangers of remote Javascript. Perl.com got hit by a JavaScript porn redirect when the domain of one of their advertisers expired and was bought by a porn company. Nat Torkington suggests keeping track of the expiration dates on any third party domains that are serving JavaScript on your site. 4 20th January 2008, 9:49 am

Automate firing of onload events. Paul Irish suggests setting up your site’s onload handlers in a single external JavaScript file then executing different handlers depending on the body element’s id attribute. 0 17th January 2008, 4:08 pm

.first() and .last() methods for jQuery. I got fed up of expecting these to exist, so I wrote them as a couple of one-liner plugins. 2 16th January 2008, 9:41 pm

jQuery 1.2.2: 2nd Birthday Present. The API stays the same, but there are some healthy speed improvements, a new way of adding custom events and (most importantly) .ready() now waits for the CSS to be ready in addition to the DOM. 0 15th January 2008, 8:59 am

Javascript CSS Selector Engine Timeline. It’s not every day you see a piece of code you wrote compared to a Ford Pinto :) 0 14th January 2008, 1:25 pm

The Art & Science of JavaScript. The JavaScript book I contributed to is now shipping! My chapter describes how to build a Flickr / Google Maps mashup entirely using client-side code (via JSON-P). 5 12th January 2008, 7:05 pm

Cross-Site XMLHttpRequest (via) “Firefox 3 implements the W3C Access Control working draft, which gives you the ability to do XMLHttpRequests to other web sites”—you can mark a document as available for cross-domain requests using either an Access-Control HTTP header or an XML processing instruction. 0 9th January 2008, 11:57 pm

$.comet (via) The first Comet (with Bayeux) plugin I’ve seen for jQuery—currently only handles long-polling over XMLHttpRequest, but still a promising start. 1 9th January 2008, 8:31 am

Why we switched to Jetty. Zimbra (recently acquired by Yahoo!) are using Jetty for Comet. It sounds like they are using Bayeux as well. 0 8th January 2008, 5:12 am

20,000 Reasons Why Comet Scales. Greg Wilkins coaxes Jetty and Bayeux in to supporting 20,000 simultaneous users per server while maintaining sub-second latency, using Amazon EC2 to run the benchmark. 0 7th January 2008, 8:32 am

IE7.js version 2.0 (beta). Dean Edwards has updated IE7, shifting enhancements that weren’t fixed by the real IE7 in to a new script called IE8. You can also now hotlink the library directly from Google’s servers, though I don’t know how intended Google Code’s subversion repository is for that purpose. 2 6th January 2008, 11:15 pm

EditArea. Impressive JavaScript source code editor, with syntax highlighting, brace matching, search and replace and more. 1 1st January 2008, 12:09 pm

JavaScript: It’s Just Not Validation! I like the explanation of JavaScript as offering input assistance rather than validation. 0 1st January 2008, 12:07 pm

Django and Comet. How to build a chat application using Django and the Orbited comet server. Orbited can be set up to proxy most requests through to a Django backend while handling any comet requests itself. 0 26th December 2007, 9:05 pm

AppJet: Instant Web Programming. Another attempt at simple server-side JavaScript application hosting. Worth checking out for the impressive syntax highlighting code editor, which even matches braces. 3 15th December 2007, 3:37 pm

ExtInfoWindow 1.0: Ajax powered, CSS customization. Finally, a semi-official way of creating customised info windows for the Google Maps API. You lose the default shadow but gain the ability to style the entire info window using CSS. 2 15th December 2007, 12:22 pm

Two-Faced Django. Excellent Django tutorial by Will Larson that shows how to build a polling application with an interface both on the Web and in Facebook. Also touches on unit testing and Ajax using jQuery. 0 14th December 2007, 2:44 pm

Unobtrusively Mapping Microformats with jQuery. My contribution to 24 ways: using Mapstraction to geocode hCards (extracted with jQuery) and plot them on a Google Map. 0 12th December 2007, 12:28 am

The Future of Comet: Part 1, Comet Today. Absolutely the best summary I’ve seen of all of the current Comet techniques in one place. 0 11th December 2007, 1:13 pm

Insert Dojo and YUI bookmarklets. Combine with Jash for interactive API experimentation on any web page. 0 9th December 2007, 12:38 pm

Jash: JavaScript Shell (via) An advanced JavaScript interactive shell bookmarklet that works in IE, Firefox, Opera and Safari. 0 9th December 2007, 12:36 pm

JavaScript Internationalisation, explained by reindeer. “Santa even spooked Comet recently by talking about him as if he were some pushy web server.” 1 8th December 2007, 2:04 pm

Comet works, and it’s easier than you think

I gave a talk this morning at the Yahoo! Web Developer Summit on Comet, cometd and Bayeux. I’ve been trying to keep up with Comet ever since Alex coined the term last year, but it’s only in the past few weeks that I’ve actually found some time to play with it myself. I was very impressed with what I found: the open source infrastructure for building and deploying Comet applications is surprisingly mature, and with just a few more improvements I can see Comet achieving much more widespread use. [... 1297 words]

YUI 2.4.0 released. Lots of great new features, but the one I’m most excited about is Selector: YUI finally has a CSS query engine. 1 5th December 2007, 3:32 pm

Datejs—A JavaScript Date Library. Building a date API around chaining—Date.today().next().thursday()—is a neat concept. I’d like to see that adapted for Python’s datetime library. 17 3rd December 2007, 9:01 pm

Transparent PNGs in Internet Explorer 6. 24ways kicks off again, with the first article introducing super-sleight, an updated script for getting transparent PNGs to work in IE6. 0 1st December 2007, 12:03 am

Jetty WebServer. Jetty 6.1 was the only cometd / Bayeux implementation I tried which worked out of the box. 0 27th November 2007, 6:43 pm

Deconstructing Facebook Beacon JavaScript. How Facebook’s new Beacon service (also known as “Facebook ruined Christmas”) actually works. 0 25th November 2007, 9:20 pm

DebugBar. Suggested at BarCamp London 3 as a useful tool for developing with IE; apparently includes a great JavaScript debugger. 1 25th November 2007, 10:32 am

A Taxonomy of Event- and REST-based Comet. Kris Zyp describes a conceptual model for Comet messages based on REST semantics (so you can send a PUT referencing a specific URI down to a client to represent an idempotent state change). 0 21st November 2007, 8:18 pm

Weewar (Nat v.s. me). Really impressive turn based strategy game, implemented entirely in the browser. Surprisingly addictive; you have been warned. 2 20th November 2007, 11:52 pm

IE ActiveX(“htmlfile”) Transport, Part II. Fascinating tricks for working around IE memory leaks using explicit CollectGarbage() calls and setInterval() to an empty function. 0 19th November 2007, 11:48 am

JavaScript Beautifier (via) Useful online tool (source code also available) for un-obfuscating JavaScript that has had its whitespace stripped out. 0 16th November 2007, 8:43 pm

Yahoo! Search Contextual Precaching. Neat performance trick on Yahoo! Search: the moment you start typing (indicating you intend to search) the site quietly fires off a bunch of requests to precache assets needed for the search results page. 0 16th November 2007, 3:58 pm

Taking the canvas to another dimension. Opera have finally released a test version with support for a opera-3d canvas context—Windows only for the moment, but Mac and Linux versions are promised “soon”. 0 16th November 2007, 1:39 pm

Ten New Things in WebKit 3. Does “incremental updates for persistent server connections” for XMLHttpRequest mean Safari now has native support for Comet? 1 16th November 2007, 1:19 am

google-axsjax (via) “The AxsJAX framework can inject accessibility enhancements into existing Web 2.0 applications using any of several standard Web techniques”—including bookmarklets and Greasemonkey. The enhancements conform to W3C ARIA, supported by Firefox 2.0 and later. 0 14th November 2007, 5:18 pm

JavaScript Method Overloading. John Resig shows a clever trick for overloading JavaScript methods based on the number of arguments, using the little-known .length property of a JavaScript function object. 0 13th November 2007, 2:39 pm

HTML5 Media Support in WebKit. WebKit continues to lead the pack when it comes to trying out new HTML5 proposals. The new audio and video elements make embedding media easy, and provide a neat listener API for hooking in to “playback ended” events. 9 12th November 2007, 11:21 pm

Eye-Fi launches. Really neat idea: a digital camera SD card with built-in WiFi to beam your photos straight to your laptop. SitePen built the UI, which runs in your browser on top of Dojo and talks to a small web server running locally. 0 11th November 2007, 10:40 pm

JavaScript Madness: Keyboard Events. Keyboard events in JavaScript are a total pain. This looks like a pretty comprehensive reference to getting them to work cross-browser. 1 9th November 2007, 11:07 pm

Pseudo-custom events in Prototype 1.6. Useful tutorial showing how to use Prototype 1.6’s custom events to implement a cross-browser mouse wheel event. 0 9th November 2007, 11:02 pm

dojo.NodeList API docs. Support in Dojo for jQuery-style chaining operations. 0 8th November 2007, 11:16 am

In the long term, I want to replace JavaScript and the DOM with a smarter, safer design. In the medium term, I want to use something like Google Gears to give us vats with which we can have safe mashups. But in the short term, I recommend that you be using Firefox with No Script. Until we get things right, it seems to be the best we can do.

Douglas Crockford 5 7th November 2007, 3:36 pm

Announcing Dojo 1.0. The tough learning curve that accompanied 0.4 and earlier has been replaced with an elegant core module (dojo) and two exciting subprojects (dojox and dijit). Well worth a look. 0 7th November 2007, 1:17 pm

Comet Daily. New regularly updated site covering Comet, the Ajax-like umbrella term for JavaScript server-push techniques. Already a bunch of great stuff on there. 0 7th November 2007, 10:53 am

Gmail Greasemonkey API (via) The new version of Gmail includes API hooks for Greasemonkey script authors. The documentation is by Mark Pilgrim, author of Greasemonkey Hacks. 1 7th November 2007, 10:38 am

How to make Ajax work for you. Slides from my three hour Ajax tutorial, presented at Web 2.0 Expo Berlin on Monday. 3 7th November 2007, 10:35 am

The Story Behind ES4. If you’re scratching your head at the recent eruption of acrimony surrounding ECMAScript 4 (the next standardised version of JavaScript) Neil Mix has a relatively easy to follow catch-up post. 0 2nd November 2007, 6:15 am

Site-specific browsers and GreaseKit. New site-specific browser tool which lets you include a bunch of Greasemonkey scripts. For me, the killer feature of site-specific browsers is still cookie isolation (to minimise the impact of XSS and CSRF holes) but none of the current batch of tools advertise this as a feature, and most seem to want to share the system-wide cookie jar. 0 25th October 2007, 7:56 am

Upgrading to Prototype 1.6: real world examples. I still don’t find Prototype as intuitive as jQuery, but the API improvements between 1.5 and 1.6 are very impressive. 2 24th October 2007, 7:19 pm

jQuery Logging (via) Brilliant four line jQuery plugin that lets you insert Firebug console.log() calls directly in to chains. 0 19th October 2007, 12:52 pm

CouchDB first impressions. Jacob’s been poking at CouchDB. Inserting data is slow, but everything else looks pretty slick considering how recently the JSON / JavaScript views functionality was added. 0 19th October 2007, 11:43 am

Dealing with the Flexibility of JavaScript. Some thoughts on function signature overloading in JavaScript. 0 16th October 2007, 11:24 am

The Art & Science of JavaScript. My first author credit: I’m contributing a chapter to SitePoint’s next JavaScript tome. 0 15th October 2007, 10:35 pm

Using the jQuery test suite for your own projects. jQuery’s test suite has clever start(), stop() and expect() methods for running assertions within asynchronous code. 0 12th October 2007, 12:56 pm

Global namespace pollution in IE. Another reason to avoid JavaScript global variables like the plague: IE creates a bunch of them for you which may well intefere with your own code. 0 10th October 2007, 10:10 am

Native DOMContentLoaded is coming to Safari. I filed this bug over two years ago. They’ve just committed the resulting patch to trunk. 1 8th October 2007, 1:07 am

Roll out your own JavaScript Interfaces. Dustin shows how to build a tiny jQuery-style (chainable) library that contains your own JavaScript convenience functions. 0 6th October 2007, 12:20 am

I have another technique [...] that I’ll be switching jQuery to. If you attempt to insert into the document.body before the document is fully loaded, an exception is thrown. I take advantage of that to determine when the document is fully loaded.

John Resig 1 26th September 2007, 12:21 pm

DOMContentLoaded for IE, Safari, everything, without document.write. Stuart has taken Hedger’s recent IE technique, combined it with the others and compressed it in to a short-as-possible code snippet that you can paste in to your scripts without having to include the whole of jQuery/YUI/Dojo/Prototype. 0 26th September 2007, 12:19 pm

IEContentLoaded. An alternative method of detecting DOMContentLoaded on IE; works by polling until the doScroll() method on an unattached element stops throwing errors. 1 24th September 2007, 12:10 pm

Hello JS-CTYPES, Goodbye Binary Components. Mark Finkle is porting Python’s ctypes functionality to the Mozilla platform, to allow binary XPCOM components to be defined in pure JavaScript. 0 22nd September 2007, 11:57 pm

Apparently if you try to remove/destroy/trash a FORM dom node in IE6, it won’t delete it, instead creating a bizarre orphaned node stuck sucking up memory until the browser window is refreshed.

Jon Sykes 0 20th September 2007, 1:04 pm

ActsAsUndoable. Lawrence Carvalho shows how robust undo functionality can be added to a JavaScript application through careful application of the Memento design pattern. 1 18th September 2007, 3:51 pm

The Elements of JavaScript Style. Douglas Crockford illustrates better coding practises through refactoring of old code. 4 13th September 2007, 8:22 am

jQuery 1.2. Lots of neat new stuff; my favourite new feature is “Partial .load()” which lets you pull in HTML with Ajax and then use a CSS selector to grab a subset of that page and inject it in to the DOM. 0 11th September 2007, 8:44 am

Google Maps API gets clickable polylines and polygons. Interesting explanation of how they optimised calculating the distance to the nearest point on a polyline. 0 8th September 2007, 12:58 pm

Protoscript (via) JavaScript tool designed for easy prototyping of JS interactions; powered by YUI and jQuery. 0 7th September 2007, 10:55 pm

HTTPOnly cookie support in Firefox. Five years after the bug was filed, HTTPOnly cookie support has gone in to the Mozilla 1.8 branch. This is a defence in depth feature that has been in IE for years—it lets you set cookies that aren’t available to JavaScript, and hence can’t be hijacked in the event of an XSS flaw. 2 6th September 2007, 6:27 am

CouchDb: Some Context. CouchDb developer Jan Lehnardt wrote up detailed notes on slides from a presentation he gave back in June, explaining most of what’s interesting about CouchDb (although without the new JavaScript function query language). 0 4th September 2007, 2:31 am

CouchDB: Thinking beyond the RDBMS. CouchDB is a fascinating project—an Erlang powered non-relational database with a JSON API that lets you define “views” (really computed tables) based on JavaScript functions that execute using map/reduce. Damien Katz, the main developer currently works for MySQL and used to work on Lotus Notes. 1 3rd September 2007, 9:48 am

Freebase. Out of closed beta, although you still need an invite code to contribute. I hope they drop the JavaScript requirement for viewing content on the site. 2 3rd September 2007, 2:35 am

Google Web Toolkit: Towards a better web. Good overview of why GWT exists, but I take exception to the title: requiring JavaScript to even display something does not make the web “better”. 1 29th August 2007, 8:21 pm

jQuery 1.1.4: Faster, More Tests, Ready for 1.2. The backwards compatibility policy for 1.2 is pretty clever: provide a plugin that restores removed functionality (such as XPath selectors). 0 24th August 2007, 4:22 pm

Building a JavaScript Library. Slides from John Resig’s Google Tech Talk. Some great tips in here, including: make your APIs orthogonal, look for common patterns, keep things extensible and write the documentation yourself. 0 24th August 2007, 4:02 pm

Live Query jQuery plugin. Ingenious plugin that lets you register jQuery event bindings to be executed when a new element matching the provided selector is added to the DOM. Performance is kept snappy by only running the check after a jQuery DOM manipulation method has been executed (append, prepend, attr etc); it won’t notice elements added using regular DOM methods. 3 22nd August 2007, 10:01 pm

Fixing GC issues on IE 6: New IE download. Microsoft have released Windows Script Host / Script Runtime version 5.7, which apparently cleans up a bunch of IE 6 memory leaks. 0 17th August 2007, 11:50 pm

Learning jQuery. An entire year’s worth of jQuery tutorials, split in to beginner, intermediate and advanced. 1 17th August 2007, 11:50 am

Operation Aborted. Another fantastically obscure IE bug: appending new elements to the HEAD element breaks if a BASE tag is present. 0 16th August 2007, 11:21 am

Prototype 1.6.0 release candidate. Prototype gets a long-needed update to its Event API, and some interesting new Function.prototype extensions. 0 16th August 2007, 8:49 am

Some Notes on the YUI Rich Text Editor. Dav Glass explains how he achieved the impressive feat of building a rich text editor widget that also works in Safari. 0 15th August 2007, 8:13 pm

Lazy Function Definition Pattern. Neat JavaScript trick: redefine a function the first time it’s called, for example to switch in different browser implementations based on object detection. 0 15th August 2007, 6:57 pm

jQuery for JavaScript programmers

When jQuery came out back in January 2006, my first impression was that it was a cute hack. Basing everything around CSS selectors was a neat idea (see getElementsBySelector) but the chaining stuff looked like a bit of a gimmick and the library as a whole didn’t look like it would cover all of the bases. I wrote jQuery off as a passing fad. [... 2608 words]

Background Iframe (bgiframe). jQuery plugin that inserts an iframe shim behind an element in IE, allowing the element to be positioned overlapping a select box without the select box showing through. 3 9th August 2007, 2:54 pm

SproutCore (via) MVC JavaScript framework used to build the new .Mac Web Gallery application. 0 7th August 2007, 11:35 pm

CodePress. “Real Time Syntax Highlighting Editor written in JavaScript”. 1 7th August 2007, 10:49 pm

jQuery in 15 minutes. A quick introduction I put together. Much more interesting in conjunction with Firebug powered demos. 5 7th August 2007, 2:57 pm

The Wii Remote API. “allows the Web page to detect all Wii Remotes that are connected to the Wii [...] this makes it possible to make Web pages interact with up to four users at the same time, a concept not normally possible with traditional JavaScript event detection.” 1 6th August 2007, 9:32 pm

YUI 2.3.0. New components are a rich text editor, dojo-style package loader, lazy ImageLoader, colour picker and unit test framework. Easier skinning as well. 0 1st August 2007, 8:20 am

Mouseover DOM Inspector v2.0. Steve Chipman’s excellent debugging bookmarklet created back in 2005—includes useful keyboard shortcuts for quickly manipulating the DOM of the current page. 0 30th July 2007, 5:13 pm

XRAY web developer’s suite (via) Smart new bookmarklet from westciv—kind of like Steve Chipman’s MODI but with the addition of the canvas element for box model visualisation. 0 30th July 2007, 5:11 pm

YUI-based Image Cropper Widget. Nice implementation of a useful widget. 0 30th July 2007, 12:56 pm

The recent announcement that Mozilla’s next JavaScript engine, Tamarin, will also be a container for functionality written in Python and Ruby (and, one assumes, beyond) is proof that JavaScript is the new Parrot.

Aaron Straup Cope 0 29th July 2007, 9:17 pm

Mozilla and IronPython: IronMonkey. Interesting to note that all three new Mozilla projects are being lead by experienced Python developers. 0 26th July 2007, 8:07 pm

Brendan Eich: New Projects. Exciting new projects from Mozilla. ActionMonkey is joined by IronMonkey (IronPython/IronRuby on Tamarin) and ScreamingMonkey (Tamarin for IE). Upgrading IE’s JavaScript using the Flash Player as a vector is a game-changing idea. 0 26th July 2007, 8:05 pm

ActionMonkey (via) SpiderMonkey + Tamarin = ActionMonkey. New JavaScript engine for Mozilla 2, incorporating code from Adobe’s Open Source ActionScript VM. 0 24th July 2007, 3:29 pm

Building Brickslayer. New tutorial from Michal Wallace on building games in JavaScript using Prototype. 1 22nd July 2007, 9:28 pm

Conflicting Absolute Positions. Neat technique, although it uses CSS expressions for IE compatibility so it may break down in IE 5 and 6 when JavaScript is disabled. 0 17th July 2007, 10:44 pm

Low Pro Behaviours 101. A neatly packaged method of enhancing an existing DOM element with pre-packaged behaviours. 0 17th July 2007, 10:09 am

J4P5: Javascript For PHP 5 (via) “J4P5 is a JavaScript interpreter written in PHP 5, that allows to run untrusted scripts in a sandbox on your server. It aims to implement most of Ecma-262 3rd edition.” 1 12th July 2007, 10:24 pm

Insert in place without document.write. Very neat trick, but I’d like to see more extensive reports on browser compatibility before committing to it. 8 12th July 2007, 9:41 am

Return of the HTTP overhead delay. Christian proposes a neat way of improving page performance, by delaying non-essential images such as avatars until after the rest of the page has loaded. 0 11th July 2007, 3:12 pm

MooTools is not compatible with any other javascript framework. If you “definitely need to work with prototype” (which you don’t, since the frameworks each provide all the functionality you need to use only one or the other) then learn how to do what you want to do in prototype. Otherwise, learn to use MooTools to do all the things you want to do. They simply do not work together, and I promise they never will.

Tom Occhino 0 8th July 2007, 7:29 am

jQuery Taconite Plugin. Lets you serialize jQuery DOM manipulation commands as an XML document for retrieval via Ajax. 0 2nd July 2007, 6:29 pm

jQuery plugin: Validation. Pretty clever way of attacking the client-side form validation problem; supports both configuration object literals and custom attributes on the form fields themselves. 0 30th June 2007, 10:26 pm

[...] Silverlight has full access to the browser DOM and you can make calls from Javascript into silverlight code and from Silverlight into Javascript. This means that you can already write the presentation layer of a client side web app in Javascript and implement your business logic in IronPython.

Michael Foord 0 16th June 2007, 12:25 am

A JavaScript Module Pattern. I’ve been using this pattern for a few months—it works really well, though I tend to keep my own code in my own namespace rather than adding it to YAHOO. 4 12th June 2007, 11:30 pm

google-diff-match-patch (via) Robust algorithms to perform the operations required for synchronizing plain text, in Java, JavaScript and Python. 0 9th June 2007, 6:15 pm

jsjuicer. Another conditional comment respecting minifier tool, this time in C++. Ships with a command line utility, unlike JavaScript::Minifier. 0 4th June 2007, 5:57 pm

JavaScript Minifier that doesn’t break code (via) Perl re-implementation of Douglas Crockford’s classic JSMin that doesn’t clobber IE’s conditional comments, by Peter Michaux. 0 4th June 2007, 5:44 pm

Google Gears DB Abstractions. Here come the ORMs. 1 4th June 2007, 8:54 am

Cross Domain Frame Communication with Fragment Identifiers. Google are using this crazy iframe/fragment trick for their new Mapplets API. 0 31st May 2007, 2:15 pm

Apollo will include Google Gears technology. Looks like Google really worked on the partnerships for this one. 0 31st May 2007, 8:30 am

Dojo Offline on Google Gears. “The great news is that the Dojo crew were in the loop wrt this project, and Brad has ported Dojo Offline to use Google Gears as the base platform.” 0 31st May 2007, 8:28 am

RSS Bling goes Offline with Google Gears. Google Gears is Google’s new offline JavaScript framework. Dion Almaer (a Google employee) has a nice example of code using Google Gears on Ajaxian. 0 31st May 2007, 8:27 am

Reducing HTTP requests using make. Nice simple recipe for concatenating JavaScript in to one file using make—doesn’t do anything for cache-busting though. 1 27th May 2007, 11:29 pm

Packing Prototype. Why Prototype doesn’t ship with an official compressed version. 0 17th May 2007, 9:52 am

dojo.query: A CSS Query Engine For Dojo. I incorrectly criticised Dojo for not having a CSS node selection tool in my talk yesterday; not sure how I missed this. 1 17th May 2007, 9:40 am

JavaScript Libraries: The Big Picture

I just gave my first talk at XTech 2007 (I’m speaking again on Friday, on OpenID). Slides are on slideshare.net. [... 40 words]

Online and offline development with the YUI and Charles (via) Stuart Colville shows how the Charles debugging proxy can be used to serve up hosted YUI files while developing offline. 0 15th May 2007, 2:41 pm

Poly9 FreeEarth (via) Seriously sexy embedable 3D Flash globe, with a JavaScript API. 0 10th May 2007, 9:17 pm

The One True Object (Part 2). Jim Hugunin describes how the DLR let’s Python / JavaScript / Ruby talk to each other using a message passing abstraction. 0 5th May 2007, 1:27 am

Dynamic Language Runtime. Miguel de Icaza describes how Microsoft’s new Dynamic Language Runtime lets you call JavaScript and Visual Basic functions from Ruby. Looks like they beat Parrot to the punch. 0 3rd May 2007, 10:29 pm

How to debug JavaScript with Visual Web Developer Express. Microsoft’s best kept secret: a decent free debugger for Internet Explorer that doesn’t require you to install Microsoft Office. 0 2nd May 2007, 2:06 pm

Timing and Synchronization in JavaScript. Comprehensive overview of how browsers (Opera in particular) load scripts and queue events, with suggestions for best practices. 0 30th April 2007, 2:24 pm

Dojo 0.9 Update. Big changes are under way in the Dojo camp. 0 29th April 2007, 8:18 pm

The sliding scale. Jeremy’s write-up of my panel at the Web 2.0 Expo, with illustrative photograph. 0 25th April 2007, 7:09 pm

Seven JavaScript Techniques You Should Be Using Today (via) Sound advice from Dustin Diaz, who is now a Googler. 0 24th April 2007, 8:20 am

The website to web application gradient. Jeremy snapped this cunning illustration at my JavaScript Libraries panel at the Web 2.0 Expo. 0 20th April 2007, 12:30 am

Death and Taxes (via) Beautiful massive zoomable/pannable infographic of the 2008 Federal Discretionary Budget. 1 19th April 2007, 2:37 am

Google AJAX Feed API (via) Simple cross-domain proxy to allow JavaScript to access any publically addressable syndication feed, with the same logic as Google Reader providing normalisation. 0 18th April 2007, 5:29 pm

SoundManager 2. JavaScript sound API, using a bridge to Flash. 0 16th April 2007, 4:47 pm

Disabling keyboard controls in the Yahoo! Maps Ajax API. map.disableKeyControls() is the incantation—without it, the map will pan when you use the keyboard to scroll up and down the containing page. 1 11th April 2007, 1:47 pm

Microsoft saw the danger of Javascript and tried to keep it broken for as long as they could. But eventually the open source world won, by producing Javascript libraries that grew over the brokenness of Explorer the way a tree grows over barbed wire.

Paul Graham 1 7th April 2007, 8:22 am

Fortify JavaScript Hijacking FUD. Bob Ippolito points out the flaws in the recent widely disseminated JavaScript Hijacking paper. While the paper does miss some important details, it’s good that more people are now aware of the security implications involved in serving JSON up wrapped in an array. 0 5th April 2007, 10:51 pm

Ext JS. Jack Slocum is building a business around his excellent Ext JavaScript library (which can now run on top of YUI, jQuery or Prototype). The library itself is LGPL, but you can pay for a commercial license and support. 1 3rd April 2007, 10:11 pm

Metaprogramming JavaScript Presentation. Adam McCrea demonstrates some incredibly elegant DSL -style JavaScript based on chaining method calls together. 0 26th March 2007, 7:45 pm

base2. Dean Edwards’ new JavaScript library which adds useful cross-browser features based on upcoming DOM standards (the Selectors API, DOMContentLoaded, addEventListener and more). 0 23rd March 2007, 5:59 pm

Rules For JavaScript Library Authors. The guiding principles behind Dean Edwards’ base2 library, entirely applicable to every JavaScript developer. 0 23rd March 2007, 5:53 pm

JavaScript/CSS Font Detector (via) Really clever trick: detects the fonts that you have installed by writing out some text and measuring its dimensions. 0 20th March 2007, 11:20 pm

DED|Chain JavaScript Library (via) Dustin’s new JavaScript library, which puts a JQuery style chained API on top of YUI. 0 20th March 2007, 10:36 am

A Zoned Defense. Using JavaScript’s date.getTimezoneOffset() to detect the user’s timezone and stash it in a cookie. 0 20th March 2007, 9:51 am

wii.js (via) A JavaScript library that lets you detect the Wii browser, and provides easy hooks for reacting to keys pressed on the Wiimote. 0 12th March 2007, 10:23 pm

Ajax3d Demo. Really impressive Virus clone, using the canvas element. 1 9th March 2007, 7 pm

Dashcode review. “Dashcode is quite possibly the best non-Firebug Javascript environment I’ve ever used.” High praise indeed. 1 5th March 2007, 9:06 pm

swf Image Replacement. Really neat idea: unobtrusively replace an inline image with a SWF, then apply effects like rotation, rounded corners and drop-shadowns. Shame it suffers from Flash-Of-Unstyled-Content. 1 27th February 2007, 7:51 pm

Serving YUI Files from Yahoo! Servers (via) If everyone who uses YUI links to the same set of files, your users will already have the YUI code cached in their browser when they arrive on your site. 1 23rd February 2007, 6:45 pm

John Resig: Thoughts on OpenAjax. I hadn’t looked in to OpenAjax—from John’s analysis it seems like they need to make it easier for open-source projects to participate and do a bunch of work to modernise their core library. 0 22nd February 2007, 10:20 pm

parseDateString function in dateparse.js return wrong date for ’2006-12-31’. I didn’t realise that you have to initialise a JavaScript Date object in a certain order; if you don’t weird bugs can result. 1 17th February 2007, 7:04 pm

Neighbourhood Fix-It. Report problems to your council across the UK. The most detailed Ordinance Survey maps anywhere online, and a superb example of progressive enhancement in action—the maps work without JavaScript, and the site even works without images! 0 17th February 2007, 5:05 pm

The Zimki Plan. Zimki is a hosted JavaScript application server by Fotango. The idea is to open source it, then build a component so developers can seamlessly switch to hosting on Fotango’s server farm if they need to handle a spike in traffic. 0 16th February 2007, 3:50 pm

Sumo! A Generic Microformats Parser For JavaScript. Dan Webb’s BarCamp talk on Metaprogramming JavaScript will be a must-see. 0 9th February 2007, 10:57 am

Live DOM Viewer (via) Neat tool from Hixie that provides an insight in to what browsers are actually thinking. 0 6th February 2007, 1:12 am

The window.onload problem (still). Peter Michaux offers the most comprehensive overview of this important topic to date. 0 5th February 2007, 8:13 pm

Fork JavaScript. A great name for Yet Another JavaScript Library. This one tries to combine the best bits from YUI and Prototype. 2 20th January 2007, 11:39 pm

MySpace: Too Much of a Good Thing? CSS customization really was just the result of forgetting to strip HTML. They “eventually” decided to filter out JavaScript(!) 0 17th January 2007, 9:09 am

jQuery 1.1. jQuery is one year old. The latest release features API improvements and some significant optimisations. 2 15th January 2007, 5:13 pm

The JavaScript alert(), confirm() and prompt() functions in Firefox, Opera and MSIE (but not Safari) will truncate the message after any null character. So an unsuspecting programmer who inserts user-provided text into one of these dialog boxes opens up an opportunity for the user to rewrite the bottom of the dialog box.

Neil Fraser 0 13th January 2007, 12:28 pm

AJAX Debugging with Firebug. Great Firebug tutorial from creator Joe Hewitt himself. I didn’t know you could trigger profiling from your own code using console.profile() / console.profileEnd(). 0 12th January 2007, 11:21 am

Offline Gmail and Blogger Using the Dojo Offline Toolkit. These are just mockups at the moment, but they’re a useful illustration of how offline browsing modes for Web applications could work. 0 10th January 2007, 12:40 pm

macrumorslive.com. The MacRumors ajax keynote coverage gets better every time—now they have live photos in addition to the text updates. Simple but effective. 0 9th January 2007, 5:11 pm

IE JScript Performance Recommendations Part 3. Once again, Microsoft’s official advice is to avoid closures entirely rather than learn how to use them safely. Sigh. 0 9th January 2007, 11:48 am

The Dojo Offline Toolkit. The Dojo Offline Toolkit will be a small, cross-platform, generic download that enables web applications to work offline. 0 7th January 2007, 10:24 pm

Javascript character set screw-ups (via) Some browsers treat JavaScript files as having the same content-type as the page from which they are linked. This could cause problems with UTF-8 encoded JSON; the workaround is serving up ASCII with unicode escape sequences. 4 21st December 2006, 3:20 pm

Why JSON isn’t just for JavaScript

Dave Winer’s discovery of JSON (and shock that “it’s not even XML”) has triggered an interesting discussion thread, on his blog and elsewhere. Plenty of people have re-assured him (and themselves) that it’s only used for JavaScript—it’s convenient in the browser but irrelevant elsewhere. [... 787 words]

Conditionally Sticky Sidebar. A nicer implementation of the trick I’m using for my add comment form; this one takes advantage of position: fixed in browsers that support it. 2 20th December 2006, 1 am

Create cross browser vector graphics. An accessible introduction to dojo.gfx, a powerful 2D drawing API built on SVG and VML. 0 20th December 2006, 12:42 am

YUI CSS Grid builder (via) The YUI CSS grid system can be hard to get your head around. This interactive tool makes it much easier to figure out. 2 16th December 2006, 10:30 pm

Making GWT Better. Explains the philosophy behind GWT. It’s all about the tools! 0 12th December 2006, 5:53 pm

GWT 1.3 Release Candidate is 100% Open Source. At least you can see how the code generator works now. 0 12th December 2006, 5:50 pm

Java SE 6 Released. “Script engines” (like JavaScript, Jython and JRuby) become a first class citizen. 0 12th December 2006, 8:48 am

WYMeditor. A semantic rich text editor that appears not to suck! 0 6th December 2006, 4:35 pm

Including Dojo, The Really Easy Way. Drop in a single include to load code on demand from AOL’s CDN. 0 28th November 2006, 12:22 pm

Introducing the Technorati Link Count Widget. I’m trying this out; it’s pretty sweet. Nicely unobtrusive too. 0 18th November 2006, 10:53 am

Tamarin

On Tuesday, the Mozilla Foundation and Adobe announced the Tamarin project, an open-source ECMAScript virtual machine based on the ActionScript engine used by Flash Player 9. [... 380 words]

Dojo 0.4 release notes (via) GFX (a 2D drawing API) is awesome; dojo.html.metrics looks extremely useful, and onDomLoad is always nice. 0 23rd October 2006, 12:39 am

Browser JavaScript in Opera. Opera monkeypatches some sites, and auto-updates the patches once a week. 0 3rd August 2006, 5:37 pm

XMLHttpRequests using an IFrame Proxy (via) Another scary hack abstracted away by Dojo. 0 1st August 2006, 5:40 pm

Notes on JavaScript Libraries

@media 2006 was a blast. Great talks, great people and some of the highest production values I’ve ever seen at a conference (check out the bags!). [... 682 words]

Fjax: Just say no

To my utter amazement, a decent amount of buzz appears to be building around a new “technology” called Fjax—much of it centred around this interview on Webmonkey, but also benefiting from a mention on the O’Reilly Radar and of course the obligatory Digg story. [... 879 words]

Brad Neuberg introduces dojo.storage. Incredibly technically impressive, embodying months of accumulated expertise. 0 1st May 2006, 11:33 pm

Speaking gigs

I’ve been doing a fair amount of public speaking recently, based on the principle that the only way to get good at it is to get a lot of practise. My last two talks were a session on Django and Web Application Frameworks at the ACCU 2006 conference and a talk on the Yahoo! Developer Network for NMK’s Beers and Innovation series. [... 304 words]

An S3 AJAX Wiki. Les continues to innovate against S3. 0 22nd April 2006, 7:09 pm

JavaScript apps with read/write access to S3. JS apps hosted on S3 could read and write to the store. 0 4th April 2006, 9:33 am

Learning Flash for programmers?

I’ve decided it’s about time I learnt some Flash, mainly because of the exciting opportunities posed by the Flash-JavaScript bridge. It’s become pretty obvious now that Flash is the most practical option for dealing with audio and video on the Web, and the bridge means that anything Flash can do is now available to JavaScript as well. Google Finance and the Yahoo! JS-Flash Maps API are just two recent examples of why this stuff is worth knowing more about. [... 138 words]

Form Hijack (via) Neat unobtrusive JavaScript trick—use document.onclick to catch events before page has loaded. 0 21st March 2006, 10:43 am

My ETech JavaScript tutorial

I gave a three hour JavaScript tutorial at ETech this morning, aimed at people with previous programming experience who hadn’t yet dived deep in to JavaScript as a programming language. It seemed to go pretty well—some good questions were asked at various points and a few people told me afterwards that they had found it interesting. [... 247 words]

Yahoo! UI JavaScript treats

The Yahoo! Developer Network was updated yesterday with a veritable gold-mine of Exciting New Stuff, coinciding with the launch of the brand new Yahoo! User Interface Blog. [... 576 words]

Yahoo! UI Library. Open Source JavaScript widgets and libraries. 0 14th February 2006, 1:12 am

Escaping regular expression characters in JavaScript

JavaScript’s support for regular expressions is generally pretty good, but there is one notable omission: an escaping mechanism for literal strings. Say for example you need to create a regular expression that removes a specific string from the end of a string. If you know the string you want to remove when you write the script this is easy: [... 362 words]

The Dojo Manual (via) Dojo finally gets some really good extensive documentation. 0 24th December 2005, 6:21 pm

Rich Text Editing With Dojo. Utterly fantastic. Beautiful API, and it even works in Safari. 0 8th November 2005, 12:52 am

TurboDbAdmin. Ajax phpMyAdmin clone built on Dojo. Worth trying the live demo. 1 4th November 2005, 3:27 pm

Firefox 1.5 developer highlights

Firefox 1.5 Beta 1 is out, and is the most exciting browser release in a very long time. It comes with the Gecko 1.8 rendering engine, which includes a ton of interesting new features. New in this version (unless you’ve been tinkering with the Deer Park series): [... 719 words]

Understanding the Greasemonkey vulnerability

If you have any version of Greasemonkey installed prior to 0.3.5, which was released a few hours ago, or if you are running any of the 0.4 alphas, you need to go and upgrade right now. All versions of Greasemonkey aside from 0.3.5 contain a nasty security hole, which could enable malicious web sites to read any file from your hard drive without you knowing. [... 809 words]

Staying social

June is finals month, but the call of @media 2005 is hard to resist. I won’t be attending the actual conference (sadly my student budget doesn’t stretch that far) but I’ll be in London on Saturday the 11th to ride on the coat-tails of the conference. [... 174 words]

Stuart’s book

I meant to mention this earlier, but Stuart’s book, DHTML Utopia: Modern Web Design Using JavaScript & DOM, has been published. I worked as a technical editor on the book, and I’m proud to have been associated with it. Don’t worry about the hairy title (apparently you have to have DHTML in it or bookshops won’t know where to put it / people won’t know what it’s about), the inside is pure gold. In their usual style, SitePoint have posted the first four chapters online for your perusal so you don’t have to take my word for it, you can try it out for yourself. [... 107 words]

Firefox Counter. How the Firefox counter works. 0 28th April 2005, 6 pm

Safari 1.3 has a JavaScript Console

My single biggest complaint about Safari in the past has been its terrible support for JavaScript debugging. Safari 1.3 has just been released, and tucked away in the Debug menu is a brand new JavaScript console option. It’s not as good as the Firefox equivalent (it throws up far too many “Undefined value, line: 0” errors for my liking) but it’s a big step in the right direction. [... 80 words]

Flickr without the Flash

One of my favourite panels at SxSW this year was the Flash vs. HTML Game Show, in which a team of HTML/JavaScript gurus took on a team of Flash gurus showing off pre-prepared solutions to tasks set for the panel. One of the challenges was to come up with enhancements to Flickr using the team’s assigned technology. [... 353 words]

Greasemonkey: Hacking the Web with JavaScript. Greasemonkey rocks! Here’s a simple tutorial from Michael Moncur. 0 8th January 2005, 12:38 pm

The Register hit by XSS

Here’s a nasty one: popular tech news site The Register was hit on Saturday by the Bofra exploit, a nasty worm which uses an iframe vulnerability in (you guessed it) Internet Explorer to install nasty things on the victim’s PC. Where it gets interesting is that the attack wasn’t against the Register themselves; it came through their third party ad serving company, Falk AG. [... 262 words]

Executing JavaScript on page load

Peter-Paul Koch recently wrote: [... 772 words]

Silly JavaScript Security. “Sorry, you do not have permission to press this key,” 0 5th December 2003, 10:42 pm

getElementsBySelector()

Inspired by Andy, I decided to have a crack at something I’ve been thinking about trying for a long time. document.getElementsBySelector is a javascript function which takes a standard CSS style selector and returns an array of elements objects from the document that match that selector. For example: [... 172 words]

A django site