title: Javascript Alertify wait for confirmation then go to another page
body: <p>I am new to <strong>alertify.js</strong>. What I am trying to do is, when the user cicks on a link, the browser should show confirmation box. If the user clicks of then go to the next page. If the user clicks cancel then stay on the same page. Is it possible to do this using <strong>alertify.js</strong>?</p>
  
  <p>Here is my HTML code.</p>
  
  <pre><code>&lt;a href="index.php" class="alert"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>Here is my JavaScript code.</p>
  
  <pre><code>$(".alert").on('click', function(){
      alertify.confirm("Are you sure?", function (e) {
          if (e) {
              return true;
          } else {
              return false;
          }
      });
  });
  </code></pre>
  
  <p>But the problem is that whenever I click on the link, I go to the index.php page before clicking on the confirm. </p>