1

I'm trying to automatically download PDF, not open in a new window or the same window. I am running an AJAX and in ajax response I'm passing a PDF URL which must be downloaded. I want to download the file by using jQuery.

I want the functionality like <a href="url" download></a>

This link works but must work by jQuery and not appending anchor tag. If possible rather create an anchor and trigger that. How can I do that? Any suggestion can be useful.

Daniel
  • 10,641
  • 12
  • 47
  • 85
  • 2
    Please see this: [http://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax](http://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax) or this http://stackoverflow.com/questions/20830309/download-file-using-an-ajax-request – meditari Sep 02 '16 at 11:31
  • 2
    Possible duplicate of [How to include a JavaScript file in another JavaScript file?](http://stackoverflow.com/questions/950087/how-to-include-a-javascript-file-in-another-javascript-file) – karan Sep 02 '16 at 11:34
  • Possible duplicate of [Download File Using Javascript/jQuery](http://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery) – Shakir Ahamed Sep 02 '16 at 12:31

0 Answers0