jQuery caller ID works in queer way
<p>Hi mega masters of JS and jQuery! I'm somewhat confused by the trick of the "click" function and think that the explanation of the problem is lying in the intricacies of jQuery and JS.</p>

<p>I have a standard binding to a click event</p>

<pre><code>$('.add-button').click( function(event) {
  $.ajax({
    url: 'superentities/new',
    headers: {
      'X-Transaction': 'GET new superentities',
      'X-CSRF-Token': '&lt;%= form_authenticity_token.to_s %&gt;'
    },
    data: {
      entity: event.target.id
    }
  });
});
</code></pre>

<p>Where I send the caller's ID to the controller. But before that I had a <code>$(this).id</code> call in my data hash in place of <code>event.target.id</code>. <code>$(this).id</code> was always undefined, although Firebug's watcher was like <code>this-&gt;id == some_unundefined_value</code>.</p>

<p>So is there somebody who can unveil this mystery for me?</p>
