开发者

How do I open a form on page exit

开发者 https://www.devze.com 2022-12-11 00:27 出处:网络
I\'m now dealing with a client request to 开发者_StackOverflow社区open a form when the user leave the page.

I'm now dealing with a client request to 开发者_StackOverflow社区open a form when the user leave the page. Can that be done?


I think you are looking for

onbeforeunload event

An event that fires before the unload event when the page is unloaded.


It seems to be impossible to create my own form and override onbeforeunload or anything else. I guess blocking it is the right thing though..

What we did is to pop a form and use the regular onbeforeunload. if the user wants to go - he will. But if he stays - he will get the questionnaire.


You can see the issue here too: onbeforeunload confirmation screen customization

0

精彩评论

暂无评论...
验证码 换一张
取 消