Simon Willison’s Weblog

Subscribe
Atom feed for javascript

707 posts tagged “javascript”

2008

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

# 27th July 2008, 11:18 am / jianshen, comet, meebo, javascript

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.

# 27th July 2008, 9:30 am / bookmarklet, firebug, firebuglite, debugging, javascript

Dojango version 0.3 released. A reusable Django application that provides Dojo, helper functions (dojo.data integration) and tools for switching between Dojo versions.

# 24th July 2008, 12:47 am / dojango, dojo, django, python, javascript

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.

# 23rd July 2008, 4:25 pm / crossdomain, windowname, dojo, javascript

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.

# 19th July 2008, 10:58 pm / closures, php, functional-programming, javascript

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.

# 4th July 2008, 3:49 pm / security, referrer, quipt, caching, optimisation, javascript, windowname, xss

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.

# 4th July 2008, 8:24 am / bugdetection, javascript, object, browsers, opera, objectdetection, browsersniffing, acid3, tinymce

eval() Kerfuffle. The ability to read supposedly private variables in Firefox using a second argument to eval() will be removed in Firefox 3.1.

# 2nd July 2008, 9:24 pm / firefox, security, privacy, javascript, john-resig

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.

# 30th June 2008, 3:57 pm / sanitization, html, blacklisting, whitelisting, javascript, fuzztesting, firefox, security

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.

# 27th June 2008, 7:01 pm / closures, javascript, firefox, modulepattern, pete-michaux

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.

# 26th June 2008, 9:39 am / greasemonkey, basecamp, security, xss, 37-signals, javascript

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, firefox

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 / 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