Simon Willison’s Weblog

Subscribe
Atom feed for javascript

719 posts tagged “javascript”

2008

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.

# 7th June 2008, 4:09 pm / 280slides, javascript, objectivec, compiler, ned-batchelder

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.

# 3rd June 2008, 7:57 am / logo, webkit, javascript, safari, squirrelfish, performance, bytecode

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.

# 28th May 2008, 11:13 pm / firebug, javascript, google-earth, dan-catt, google

QUnit. The jQuery unit testing framework is now documented and supported as a separate project.

# 26th May 2008, 5:31 pm / qunit, jquery, javascript, testing, unittests

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.

# 18th May 2008, 10:45 am / aspects, aop, javascript, decorators, python, dojo, dojox, eugenelazutkin

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.

# 17th May 2008, 11:35 pm / json, dopplr, geonames, yahoogeo, whereonearth, matt-biddulph, jsonp, javascript, mapping

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)”.

# 16th May 2008, 12:14 pm / firebug, debugging, javascript

Cubescape. Beautiful isometric cube building tool by Cameron Adams, written in JavaScript and jQuery.

# 15th May 2008, 8:40 am / isometric, cubescape, cameronadams, javascript, jquery

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.

# 15th May 2008, 8:06 am / jeremiah-grossman, flash, javascript, security, csrf, xss, crossdomainxml

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.

# 15th May 2008, 7:55 am / facebook, comet, javascript, erlang, darklaunch, scaling

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.

# 14th May 2008, 9:21 pm / mark-pilgrim, iphoto, javascript, goog, googledoctyp

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.

# 14th May 2008, 9:12 pm / jquery, goog, google, googledoctype, gwt, javascript, dojo, libraries, yui

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.

# 14th May 2008, 8:34 pm / google, javascript, googledoctype

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.

# 14th May 2008, 7:10 pm / google-maps, javascript, ajax, wikipedia

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.

# 13th May 2008, 9:59 pm / javascript, json, crossdomainstorage, sessions, security

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

Me

# 13th May 2008, 1:49 pm / me, twitter, google, javascript

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.

# 13th May 2008, 8:09 am / persevere, comet, javascript, json, rest, restful, couchdb

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.

# 9th May 2008, 8:24 am / processing, john-resig, javascript, canvas

Unobtrusive JavaScript with jQuery. The online handout for the tutorial I gave this morning at XTech.

# 6th May 2008, 6:53 pm / jquery, javascript, handout, xtech, xtech08, unobtrusive-javascript

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.

# 22nd April 2008, 7:02 pm / binary, ajax, ie, firefox, vbscript, javascript, xmlhttprequest

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.

# 19th April 2008, 10:58 pm / html5, javascript, standards, unobtrusive-javascript, html, dojo, customattributes

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.

# 19th April 2008, 4:38 pm / javascript, douglas-crockford, books

Comet at the Highland Fling. I thoroughly enjoyed the Highland Fling yesterday. Here are the slides from my talk on Comet.

# 4th April 2008, 10:13 am / comet, highlandfling08, my-talks, conferences, javascript

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.

# 4th April 2008, 8:27 am / javascript, syntaxhighlighting, dom

Advanced JavaScript Debugging Techniques. There’s more to JavaScript debugging than just Firebug.

# 4th April 2008, 7:51 am / firebug, javascript, debugging, sitepen

Brendan Eich: Popularity. I never knew that Brendan went to Netscape on the promise of “doing Scheme in the browser”.

# 4th April 2008, 7:30 am / brendan-eich, javascript, scheme, netscape

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.

# 1st April 2008, 9:48 am / john-resig, namespacing, jquery, javascript, parody, funny, aprilfools

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.

# 26th March 2008, 8:28 am / getelementsbyclassname, javascript, john-resig, firefox3, namespaces, prototype, safari

Firebug + Dijit tips. News to me: Firebug has a magic $1 variable which corresponds to the currently selected node. Very handy.

# 17th March 2008, 2:08 am / firebug, javascript, debugging, dojo, dijit

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.

# 16th March 2008, 4:24 pm / dojo, dojox, gfx, javascript, drawing, 2d