最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to distinguish Unload Event triggered by Refresh or Window Close? - Stack Overflow

programmeradmin1浏览0评论

Unload Event can be triggered both by Refresh action and Window Close action. is there a way to distinguish which action that actually trigger it? In my situation, i want to ignore the Refresh action. Could you please give me some insight what the work around is?

I noticed that there is already this sort of question asked, but it seems to they are all unresolved. Therefore i came up this question again and hopefully some intelligent guy can solve this problem.

Unload Event can be triggered both by Refresh action and Window Close action. is there a way to distinguish which action that actually trigger it? In my situation, i want to ignore the Refresh action. Could you please give me some insight what the work around is?

I noticed that there is already this sort of question asked, but it seems to they are all unresolved. Therefore i came up this question again and hopefully some intelligent guy can solve this problem.

Share Improve this question edited May 23, 2017 at 10:24 CommunityBot 11 silver badge asked Jun 25, 2010 at 5:33 didxgadidxga 6,1455 gold badges45 silver badges60 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 8

I do not believe the browser can distinguish between the two events.

Both are an unload event, and both will call any unload function that you have made.

发布评论

评论列表(0)

  1. 暂无评论