Category: JavaScript

Getting confused between closures and eval()

19 June, 2009 (23:51) | JavaScript, Programming

I just saw a question regarding closures in JavaScript regarding code similar to the following:

for (i=0;i<n;i++){
foo.bind( function() { bar(i); } );
}

The question was why does every closure execute bar(i) with i as the value of n for every instance, rather than whatever the value of i was when the closure […]

The difference between window.setTimeout() and window.setInterval()

1 August, 2008 (12:49) | JavaScript, Programming

From what I’ve seen, the problem most people have with the difference between these two JavaScript functions isn’t knowing what they do, but it’s knowing that they both exist. I’ve seen lots of people constantly call setTimeout() calling the same function over and over where the last line of the function calls setTimeout(), but […]

Getting your extension to work with Firefox 3.0

18 June, 2008 (13:20) | JavaScript, Programming

When you develop a Firefox extension you’re required to specify the minimum and maximum versions of Firefox which your extension is known to work with. This is done by specifying a minVersion and maxVersion in the install.rdf file inside your plugin’s archive. Since my ClearSkyPlugin isn’t likely to break in any future version of […]

Some great advanced JavaScript videos

22 May, 2007 (15:40) | JavaScript

Douglas Crockford of Yahoo has made some excellent JavaScript lecture videos. He covers how to work around the issues in JavaScript to make it more scalable and easier to work with. I’ve yet to even see a book or anything else which could be purchased for money which delves into the details of […]