Optinal arguments that aren't really optional (or thank-you, again, FireFox)

The error: "uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame"

The cause: Not providing the supposedly-optional-but-not-always-optional-for-every-browser-third-argument to the addEventListener method in JavaScript.

I had:

document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });

I should have written:

document.body.addEventListener('touchmove', function(e){ e.preventDefault(); }, false);

Firefox, I hate you. Love, Aral (who hasn't slept yet and it's almost 11AM) xxx

Comments