title: How to refresh the current page in javascript and then call jQuery functions
body: <p>When <code>a.format24</code> is clicked, I want the page to reload then <code>.fadeOut()</code> an element and change some text. Obviously, the way the code set up below is wrong because the page reload and jQuery functions are occurring at the same time. Running the jQuery functions through the <code>location.reload()</code> doesn't work, so I'm out of ideas.</p>
  
  <pre><code>$(document).ready(function() {
          $("a.format24").toggleClick(function() {
              location.reload();
              $("div.toggleWrap").fadeOut();
              $(this).text("Use am/pm format");
              }, function() {
              location.reload();
              $("div.toggleWrap").fadeIn();
              $(this).text("Use 24-hour format");
          });
  });
  </code></pre>