# Using "beforeunload" with live redirects

**URL:** <https://forum.elixirforum.com/t/using-beforeunload-with-live-redirects/57504>\
**Category:** Questions\
**Tags:** phoenix, liveview\
**Created:** [August 8, 2023, 11:33am UTC](https://forum.elixirforum.com/t/using-beforeunload-with-live-redirects/57504 "2023-08-08T11:33:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![regex.sh](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/regex.sh/32/17382_2.png) [@regex.sh](https://forum.elixirforum.com/u/regex.sh)\
**Post date:** [August 8, 2023, 11:34am UTC](https://forum.elixirforum.com/t/using-beforeunload-with-live-redirects/57504/2 "2023-08-08T11:34:48Z")

</div>

Maybe you could assign a class to `link` and then add event listener to all classes on the page?

---

_[View the full topic](https://forum.elixirforum.com/t/using-beforeunload-with-live-redirects/57504)._
