Scoping anonymous functions
Tuesday, May 6th, 2008
This is obviously a no-brainer in that knowing something like this works in JavaScript, but it never really occurred to me to even do such a thing until today. Take the following example which ‘calls’ the anonymous function within a unique scope:
Scoping anonymous funcitons
var o = 'hello world';
(function() {
alert(this);
}).call(o);
It seems ridiculous (in a good way), but it works!
Continue reading | 15 Comments
Prototypes
- Simple Image Popouts
Submitted by Matt Snider - Creating an After Effects Numerical Input
Submitted by Josh - Using the XML DOM Without Writing 15,0000 Lines of Code
Submitted by Stephen Sorensen - SWF Integrator
Submitted by daweed - dsHistory Browser History Manager
Submitted by Andrew Mattie - Forcing references/pointers to any variable in JavaScript - a simple hack
Submitted by Stephen Sorensen - Visual JavaScript
Submitted by Ray Hauge - Simple, Semantic Rating System
Submitted by Matt Snider - SearchPlay using Prototype
Submitted by Mats Lindblad - iPhoto-Like Thumbnail Browser
Submitted by Jim Rutherford
Dailies
- Google's JavaScript library
- The infamous question of "when do we get folders in Gmail?
- Go away and leave me alone
- Ever wondered how to wear a mini skirt?
- A collection of my best photos
- More rumors of Nikon making 24 megapixel D3x
- Douglas is writing a book on the good parts
- And this is why the break tag exists in HTML
- Steve Ganz Aces the 10th at La Mirada
- Google I/O Development Conference
- It's coming soon...
- Sigma makes a break-through lens with the 200-500mm f/2.8
JavaScript Video Tutorial Screencasts
Learn the fundementals of the Yahoo! User Interface utilities
and how to add progressive enhancements to your webpages with only applying the basics.
Download QT Movie (19MB)
Learn how to add Ajax to your website using the Yahoo! UI Connection Manager with
minimal code and maximum flexibility.
Download QT Movie (31MB)
Learn how to write a client-side Web Service API in JavaScript using Object
Oriented methodologies along with a best-practices approach that will allow you to
play nice with the other JavaScript kids in your neighborhood.
Download QT Movie (19MB)
People
Podcasts
Episode 16: A fictional JavaScript tale
This episode was done solo as I tell a fictional tale about five JavaScript kids (among others) that I wrote during a night I wasn’t able to get any sleep. It features a few of the greatest JavaScripters around as the characters including the following:
- Dustin Diaz (myself)
- Dan Webb
- John Resig
- Peter Paul
- Justin Palmer
- Copy Paste Boy (Billy)
Episode 15: Venni viddi vicci of Events
Justin Palmer in many ways felt like the brother I never had even though I will claim to have other JavaScript mafia brothers as well.
Aside from that matter, the “Experience Engineer” from Encytemedia (and Prototype enthusiast) and I spoke about the various forms of Events that all encompass JavaScript. And indeed; we came, we saw, and we conquered.
About ./with Imagination
Hi, my name is Dustin Diaz and I am a User Interface Engineer for Gooooogle and author of JavaScript Design Patterns. This is my website. Welcome!
On this site I write about JavaScript; I have some podcasts; I also have a few screencasts for those of you who are visual learners. All that aside, if you learn something from me: Excellent. I appreciate you dropping by.
If you have any more interest in learning more about what I do, how long I've been doing it, or how to get a hold of me, you can do that on the about page. Cheers.















