0

I have an event handler for the beforeunload window event.

window.addEventListener("beforeunload", myScript);

I also have an A tag which his href is a download file link. So when I click on the link the browser file download popup opens and it causes the beforeunload to get fire. How can I prevent this from this specific link?

 <a href="link">Download</a>
undefined
  • 5,550
  • 9
  • 39
  • 71

1 Answers1

1

open a new tab

<a href="link" target="_blank">Download</a>
xianshenglu
  • 4,593
  • 2
  • 15
  • 30