title: Jquery AJAX submits the form even if confirm() method is false
body: <pre><code>&lt;div class="report" data-id="55"&gt;&lt;/div&gt;
  
  &lt;script&gt;
  $('.report').click(function() {
      var id = $(this).data("id");
      confirm("do you really want to report this post?");
  
      $.ajax({
          url: 'forumreport.php',
          type: 'GET',
          data: 'id='+id,
          success: function(){
              alert("reported!!");
          },
      });
  })
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to stop <code>$.ajax()</code> method if user clicks cancel on confirm form. However ajax is still sending the id to .php page. What should i do?</p>