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.
});

Yay~! Yay~!

I made it! An interactive map with point, click, store values and shit with JQuery. Yay~! It’s just a matter of time to write a function to send values to MySQL database. Take that mofo!