title: Loading & unloading for $(location).attr('href',url) function
body: <p>this function <code>downloadcsv()</code> function it takes 30sec to download .csv file in the meantime, we try do loading and unloading to the function  how can we do this </p>
  
  <pre><code>&lt;a class="dwnload-cv" onclick="downloadcsv('latecomerrpt');" href="javascript:void(0);"&gt;
      &lt;span class="btn btn-block btn-primary"&gt;
          &lt;i class="fa fa-download"&gt;&lt;/i&gt; Download CSV
      &lt;/span&gt;
  &lt;/a&gt;
  
  
  function downloadcsv(tagname) {
      $(location).attr('href','download.php?act='+tagname+'&amp;'+$("#search").serialize());
  }
  </code></pre>