Archive for March, 2008

Sure, Leave Me a Voicemail

I used to hate when people would call my phone and leave a voicemail message telling me to call them. First off, I know you called. It said so when I pressed ‘ignore’. Second, it’s kind of a no-brainer that, when someone calls, you call them back. Lastly, I really don’t care anymore anyways because I have Visual Voicemail, which means I can delete your message without even having to hear it. So go ahead, leave a message. It’s not my time you’re wasting. (Note: rant does not apply to informative, interesting, or otherwise useful messages.)

The Global Object Model

Levi and I came up with a real-life equivalent to the Document Object Model (DOM).  It’s called the Global Object Model (GOM), and it can be used to organize, reference, and manipulate elements around the globe using simple JavaScript statements.

Where the DOM limits you to window and document, the GOM opens the door to bigger and better things.  For example:

var idiot = world.countries['USA'].currentPresident();
alert( idiot.approvalRating() ); // outputs 3%

The GOM supports event handling.  The following code would guarantee that I alway have Taking Back Sunday tickets as soon as the band goes on tour:

world.musicians['TakingBackSunday'].onTour = function() {
world.people['cory'].buyTickets();
}

Error catching is easy with the GOM:

try {
world.people['cory'].fartInPublic();
} catch {
alert('Excuse me!');
}

I’m even working on a jQuery port so we can minimize the amount of code and the time it takes to write said code.  Now, you can reference multiple people, places, and things with simple CSS selectors.  To make it snow in Las Vegas, Phoenix, and Albuquerque, we say:

$('#las_vegas, #phoenix, #albuquerque').weather('snow');

To invoke uproar in every U.S. city simultaneously, we could use:

$('#USA .city').pandemonium();

Standard jQuery functions still work:

$('#reportCard').hide(); // for kids with bad grades

$('.breasts').show(); // at Mardi Gras

$('#g_w_bush').replaceWith('#mr_t'); // a better choice

And, of couse, chainability.  Here’s how I would wake up every morning:

$('#cory').onWake( function() {
$(me).shower().brushTeeth().getDressed().goToWork();

});

And, in case you’re wondering, within a few minutes I’ll be doing something like $(‘#cory’).sleep();