JSON Delete Table Row
<p>I'm trying to delete a row of data using JSON, however when I prompt a confirm dialog my javascript function doesn't work as follows:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $().ready(function() {
      $("a.delete").click(function() {
        $.ajax({
          type: "POST", contentType: "application/json; charset=utf-8", url: this.href, data: "{}", dataType: "json",
          success: function(msg) {
            if (msg.status == "ok") {
              $("tr#" + msg.id).hide();
            }
            else {
              alert(msg.exception);
            }
          }
        });

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

<p>The above works absolutely fine, but the minute I put the following in:</p>

<pre><code>  &lt;script type="text/javascript"&gt;
    $().ready(function() {
      $("a.delete").click(function() {
        if (!confirm("Are you sure you want to delete this?")) return false;
        $.ajax({
          type: "POST", contentType: "application/json; charset=utf-8", url: this.href, data: "{}", dataType: "json",
          success: function(msg) {
            if (msg.status == "ok") {
              $("tr#" + msg.id).hide();
            }
            else {
              alert(msg.exception);
            }
          }
        });

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

<p>This <strong>does</strong> carry out the delete, but it doesn't hide the table row, which makes me think it hasn't been deleted.  Any ideas?</p>
