Blog


Trivial JavaScript

I've been chatting with the Free Software Foundation and they've posed a tricky question: What is trivial JavaScript? - or - What is not trivial JavaScript?

It seems like an especially hard question to answer - especially without using subjective terms.

For example I would say that the following are all trivial:

Use of inline JavaScript/DOM 0-style code [...]

25 Comments · Posted: June 10th, 2008 · Tags: javascript


Writing ECMAScript 4, Today

A very cool new utility has just been released by Olav Junker Kjær called Mascara which is an ECMAScript 4 to JavaScript translator (written in Python).

Using this utility you can begin writing ECMAScript 4 code today, receiving its full benefits (such as IDE integration and compile-time type-checking) while still being able to run the resulting [...]

13 Comments · Posted: June 10th, 2008 · Tags: javascript, ecmascript, python


Recent Presentations

During the past couple weeks I've given a number of talks around the globe. Here's a quick dump of the talks for those that are interested in them.

jQuery (BarCamp Boston)
Processing and Processing.js (BarCamp Boston)
jQuery (MeshU)
Managing the Mozilla Way (Slashdot, ITWorld)
jQuery (DrupalCamp Toronto)
JavaScript 1.5 to 2.0 - A new talk examining all the language features introduced [...]

7 Comments · Posted: June 8th, 2008 · Tags: speaking, conferences, presentations, javascript, jquery


__FILE__ in JavaScript

A quick snippet that I spotted within the up-and-coming Johnson project (A Ruby/Spidermonkey hybridization.):

[js](function(){
this.__defineGetter__("__FILE__", function() {
return (new Error).stack.split("\n")[2].split("@")[1].split(":").slice(0,-1).join(":");
});
})();[/js]

The above defines a global variable __FILE__ which, when called, returns the file name of the current JavaScript file. It's defined using a getter in particular so that the proper [...]

7 Comments · Posted: June 7th, 2008 · Tags: javascript, ruby, spidermonkey


Processing.js Tower Defense

I'm currently in the process of touring the globe (I've given four talks in two cities, have two talks in two cities left) but I dug up something that should prove to be a lot of fun.

Will Larson has gone about revising the classic Tower Defense genre, porting it to the open web using Processing.js. [...]

13 Comments · Posted: May 27th, 2008 · Tags: games, javascript, processing


Injecting Word Breaks with JavaScript

Recently Eduardo Lundgren pinged me wondering if I had an alternate solution to injecting wbr tags inside a long word.

The wbr tag tells the browser where a possible line break can be inserted, should the need arise. (Opera has some problems with rendering them correctly, but it can be rectified using some CSS.) By adding [...]

12 Comments · Posted: May 24th, 2008 · Tags: javascript, words, language


postMessage API Changes

It's been a little while since I last wrote about Cross-Window Messaging in Firefox 3 using postMessage and since that time it's since a few API updates.

Specifically the postMessage API has become much simpler and has stronger security brought into mind.

If you're unfamiliar with postMessage here's a quick re-cap: It's a way to communicate simple [...]

7 Comments · Posted: May 22nd, 2008 · Tags: security, javascript, browsers, firefox


Title Capitalization in JavaScript

The excellent John Gruber recently released a Perl script which is capable of providing pretty capitalization of titles (generally most useful for posting links or blog posts).

The code handles a number of edge cases, as outlined by Gruber:

It knows about small words that should not be capitalized. Not all style guides use the same list [...]

41 Comments · Posted: May 21st, 2008 · Tags: blog, javascript


Next entries » · « Previous entries

Current Projects

jQuery JavaScript Library

jQuery

Comprehensive DOM, Event, Animation, and Ajax JavaScript Library.

Recent Projects

Pro JavaScript Techniques

JavaScript Book

The best techniques for professional JavaScript. Published by Apress.


Hosting provided by the cool dudes at Engine Yard.