send the img id to another file with ajax
<p>I am trying to make this work, I have some images each one of them has this link with its own id. </p>

<p>this is the link: <code>&lt;a href="#" class="remove_img" data-id="'.$img-&gt;g_id.'"&gt;x&lt;/a&gt;</code></p>

<p>this is the script: </p>

<pre><code>&lt;script&gt;
$(document).ready(function() {
    $(".remove_img").click(function() {
        e.preventDefault();

        var id = $this.data('id');
        $.ajax({
           url: 'remove_img.php',
           type: 'POST',
           data: { bild : id },
           success: function(data) {

            alert("Gespeichert!");

          }
        });
    });
});
&lt;/script&gt;
</code></pre>

<p>and I receive the id in the remove_img.php like this: <strong>$_POST['bild']</strong></p>

<p>in the chrome console I see this error: </p>

<blockquote>
  <p>$this is not defined (repetead 2 times)</p>
</blockquote>
