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
  • 6,366
  • 12
  • 46
  • 90

1 Answers1

1

open a new tab

<a href="link" target="_blank">Download</a>
xianshenglu
  • 4,943
  • 3
  • 17
  • 34