title: Trigger a browser download with JQuery
body: <p>My goal is to let a user download a PDF from my server. 
  The most common approach to this would be to simply have a link with a download attribute like so </p>
  
  <pre><code>&lt;a href="http://mysource.pdf" download&gt;click here&lt;/a&gt;
  </code></pre>
  
  <p>The problem with this is that I cannot monitor the download or have a callback when it is finished. The browser just hangs until the request is processed and suddenly pops up a download when it is done. 
  So now I am getting pdf data from a server with AJAX and want to download the data via the browser.<br>
  So I have something along the lines of </p>
  
  <pre><code>$.get("http://mysource.pdf", (data) -&gt;
    #need to somehow trigger a download with this data
  )
  </code></pre>
  
  <p>I've been searching for a while to no avail. 
  Any help is appreciated. Thanks!</p>
  
  <p>--edit To clarify why this is not a duplicate, I am asking about triggering a download on data, not a local file. </p>