Note to Self

To bind an event handler for the current and future selector, use .live() method.

For instance you have:

$('.button').click(function() {   
// do things.
});

This will work when the button class element is clicked. But when you add another button class element:

$('body').append('<input type="button" value="Click Here" class="button" />');

This won’t work, since it was added later by the .append() method. To get around this, use .live() method. This will work for the current and the future elements.

$('.button').live('click', function() {
  // do things here.
});

"Declare variables, not war."

The last words of programmer Bill Zeller

iheartchaos:

Hey CBZ, I just got finished reading this, I am at a complete loss for words. I think everyone needs to read this.

Bill Zeller was a highly talented programmer and Princeton graduate who had used programming and the programming community at large not only because that’s where he was highly skilled, but because it’s where he found solace, and a way to deal with the pain of being psychologically and sexually abused through much of his childhood. This past Sunday, Zeller took his own life and left the following letter to not only the lives of those he touched, but to everyone at large.

Read More