title: redirect to another page after successful insertion of data via AJAX
body: <p>After successful insertion of date I want to redirect to another JSP page. </p>
  
  <pre><code>$.ajax({
                  type: "post",
                  url: "register.jsp",
                  data: datastring,
                  success:function(){            
                                  window.location.href = "nextPage.jsp";
                  }
  </code></pre>
  
  <p>but I can not redirect to another page (nextPage.jsp) but the insertion of data to database is successful. How to redirect to
  another page??? </p>
  
  <p>I also tried </p>
  
  <pre><code>success:function(){
  $("divid").load("nextPage.jsp") }
  </code></pre>
  
  <p>but this is also not working.</p>