Clicking on a link for the same hash-based URL

Clicking on a link for the same hash-based URL

This is best explained via an example.  Different browsers handle this differently, but at least in Firefox...


Click on 'Recent Posts'.  When the page has finished loading, click the same link again.  The page will not reload.


For all hash-based links, you need something like:

   
  1.  $("a[href*='#']").click( function() {
  2. if ( $(this).attr("href") == window.location.href ) {
  3. window.location.reload(true);
  4. return false;
  5. }
  6. });

Assuming hrefs contain absolute paths, of course.