开发者

jQuery get beforeunload event source id

开发者 https://www.devze.com 2023-01-14 10:38 出处:网络
I am trying to alert the user when they leave the shopping page with cart filled up. And also get feedbac开发者_运维知识库k or the reason for their exit.

I am trying to alert the user when they leave the shopping page with cart filled up. And also get feedbac开发者_运维知识库k or the reason for their exit.

I need to get event source id because to know whether they exit my site or navigate by clicking a link in my page.

Any one help me on this...


It's not possible. You should be able to catch if the user clicked a link to leave the page by manually setting up a listener event on each of them, but the browser does not give you any information about what led to the unload event. If it was an event ouside the document ("Back" button etc.), you're out of luck.

0

精彩评论

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