Simon Willison’s Weblog

Subscribe
Atom feed for javascript

689 items tagged “javascript”

2008

jsontime. Nat and I threw this together this morning—it runs on Google App Engine and exposes Python’s pytz timezone library over JSONP.

# 21st June 2008, 7:07 pm / jsontime, json, javascript, api, projects, python, pytz, appengine

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.

# 19th June 2008, 6:09 pm / javascript, jquery, firefox2, ie6, drew-mclellan, css, bugs, browsers, opacity, pngs

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.

# 16th June 2008, 10:20 am / jquery, javascript, profiling, john-resig

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.

# 15th June 2008, 11:32 am / javascript, john-resig, spidermonkey, python, java, php, perl, ruby, embedding

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.

# 10th June 2008, 6:41 am / javascript, jeff-atwood, stackoverflow, unobtrusive-javascript

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

# 9th June 2008, 8:30 am / maps, ordinancesurvey, openspace, javascript, geo

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

# 8th June 2008, 8:46 pm / jquery, javascript, bookmarklets, karl-swedberg

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.

# 7th June 2008, 7:40 pm / objectivej, javascript, objectivec, 280north, ajaxian

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 / jeremiahgrossman, 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, eval, 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