title: AJAX load page and reload/add after success
body: <p>So I have a page which, when requested, updates my database. For example when I go to <code>database_update.php</code> it just updates the database and doesn't show anything.</p>
  
  <p><code>Index.php</code> shows user database content.</p>
  
  <p>So I have function in JavaScript called <code>update</code> which must use AJAX to run this page and after the page loads (after all queries run successfully) it must load <code>index.php</code> and show updated page to the user (reload the page without refresh effect).</p>
  
  <p>My code is like:</p>
  
  <pre><code>$.get('ajax_update_table.php', {
      // The following is important because page saves to another table
      // users nick which call update:
      update: UserLogin
  }, function (output) {
      // The following is unimportant:
      $(myDiv).html(output).show();
  });
  </code></pre>