title: jQuery location.reload to happen after ajax success
body: <p>I have a main problem working with ajax success when I try to reload a web page. In ajax success, I have both <code>location.reload</code> and <code>window.location.hash</code>. After this location.reload, I need to trigger a click event to open up a closed div.</p>
  
  <p>But unfortunately, its the click event that is triggered first and location reload happens after ajax success. Below is my code.</p>
  
  <pre><code>$.ajax({
          url: updatedUrl,
          dataType: 'json',
          type: 'post',
          data: 'id=' +  id,
          complete: function() {},
          success: function(data) {
              $('.overlay').hide();
              alert(data.status+': '+data.message);
              location.reload();
              window.location.hash = 'link';
              $('toggle-arrow').trigger('click');
          },
          error: function(xhr, ajaxOptions, thrownError) {
              alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
          }
  });
  </code></pre>
  
  <p>Is there any way to trigger the click after location reload?</p>