Skip to content Skip to sidebar Skip to footer

How To Redirect A User To A New Webpage After A Javascript Alert/confrim Box

I have a client who wishes to have an alert/confirm box pop up when a user leaves the site, then based on what they choose, they will either stay on the page or go to a new page (w

Solution 1:

The correct event handler name is onbeforeunload (not onbeforeOnload). See this SO question and my answer (it points to MDN, which has a small example of how to implement what you are looking for.)


Post a Comment for "How To Redirect A User To A New Webpage After A Javascript Alert/confrim Box"