title: Get information about the source of an event with jQuery
body: <p>A function is bound to an event for many objects. One of those objects fires the event and jQuery kicks in. How do I find out who fired the event inside the JavaScript function?</p>
  
  <p>I've tried using <code>function [name](event){}</code> and poking at event but I get "'data' is null or not an object".</p>
  
  <p>Here's my code right now:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
      $('.opening').bind("click", function(event) {
           //code to populate event.data since right now, the tags don't hold the info...they will eventually with an XHTML custom namespace
              event.data.building = "Student Center";
              event.data.room = "Pacific Ballroom A";
              event.data.s_time = "9/15/2009 8:00";
              event.data.e_time = "9/15/2009 10:00";
  
              indicatePreferenceByClick(event);
          });
      function indicatePreferenceByClick(event) {
          alert("I got clicked and all I got was this alert box.");
          $("#left").load("../ReserveSpace/PreferenceByClick", { building: event.data.building, room: event.data.room, s_time: event.data.s_time, e_time: event.data.e_time});
      };
  &lt;/script&gt;
  </code></pre>