title: JavaScript: How to download a file, then force a page reload?
body: <p>As the title mentions, I am trying to download a file which is served with associated mime type via PHP script given by href URL, then reload the same page, but can't quite figure it out, here's what I have so far:</p>
  
  <pre><code>&lt;a id="viewAttachmentLink" href="/path/to/script.php?id=123"&gt;View Attachment&lt;/a&gt;
  
  &lt;script type='text/javascript'&gt;
      jquery('#viewAttachmentLink').bind('click', function() {
          if (myFunction()) {
              window.location.href = "jquery(this).attr('href')";
              setTimeout(location.reload(), 400);
          } else {
              return false;
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>With this code, it will reload the page, but appears to not make the call to the PHP script.</p>