- Joined
- Mar 19, 2023
- Messages
- 3
- Reaction score
- 0
HI there,
I am trying to create a div box with image and when clicked it downloads a pdf file. I can successfully do this by using window.open(filename) but this will open a new window and display the pdf AND show the URL of the ebook at the top which I dont want. I simply want the file to download. Im testing this on Chrome.
This is what I have so far:
$(document).on('click', '#dl_pdf', function(){
window.open("/ebooks/my_book.pdf");
});
Thank you!
I am trying to create a div box with image and when clicked it downloads a pdf file. I can successfully do this by using window.open(filename) but this will open a new window and display the pdf AND show the URL of the ebook at the top which I dont want. I simply want the file to download. Im testing this on Chrome.
This is what I have so far:
$(document).on('click', '#dl_pdf', function(){
window.open("/ebooks/my_book.pdf");
});
Thank you!