I just want to start a download of a pdf-file on a button-click. But in the way I'm doing that, the browser always opens the file.
<button id="target">Download</button>
$(document).on('click', '#target', function () {
window.location.href = 'http://website.com/anything.pdf';
});