title: How do i implement a confirmation dialog/box before ajax request is send to server?
body: <p>In my admin panel I'm editing user details with Jquery/Ajax by clicking on a link. It's successfully working but I want to show confirmation dialog/popup box before request is send to server. If It's yes then my function <strong>(myfunc1)</strong> will be executive otherwise it will be close. My current code is look like this.</p>
  
  <pre><code>&lt;td width="70"&gt;&lt;a href="#" onClick="myfunc1('&lt;?php echo $uid;?&gt;') "&gt;&lt;input type="button" value="Edit Details" class="button" /&gt;&lt;/a&gt;&lt;/td&gt;
  
  function myfunc1(id) {
      id = id;
      $.ajax({
          url: 'edit_user_details.php',
          type: 'post',
          data: {
              'id': id
          },
          success: function (response) {
              //$('#edit_user_result').html(response);          
              $('#sent_password_result' + id).html(response);
              setTimeout(function () {
                  $('input[type=submit]').attr('disabled', false);
                  window.location.href = "users.php";
              }, 5000);
          }
      });
  }
  </code></pre>
  
  <p>How can I do this with jquery/Javascript ? Thank you for your help. </p>