title: ajax page refresh on form submit success
body: <p>i am using this ajax code to submit a form</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  $("#ticketupdate_message").hide();
  $("#ticketupdate_please_wait_box").hide();
  $("#ticket_update").submit(function(e){
      $("#ticketupdate_message").hide();
      $("#ticketupdate_please_wait_box").show();
      e.preventDefault();
      dataString=$("#ticket_update").serialize();
      $.ajax({
          type: "POST",
          url: "reviewtickets_history.php?seq=&lt;?php echo $_GET["seq"]; ?&gt;",
          cache: false,
          data: dataString,
          success: function(res){
              $("#ticketupdate_please_wait_box").hide();
              $("#ticketupdate_message").html(res);
              $('#ticketupdate_message').fadeIn('slow');
              $('.overlay').fadeOut();
              if(res.indexOf("success")!=-1)
              {
                  window.location.href = res.substr(8);
              }
              else
              {
                  $("#ticket_update")[0].reset();
              }
          }
      });
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>how can i add a page refresh if it was successful?</p>