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.