Javascript, Can I “redirect” user in onbeforeunload? If cant, how to

后端 未结 4 782
Happy的楠姐
Happy的楠姐 2020-12-06 17:28

Is it possible to redirect to another page when the user closes the browser?

Attempts:

  1. I tried onunload, does not work

    window.onunlo         
    
    
            
4条回答
  •  执笔经年
    2020-12-06 18:10

    The simple answer is no. If browsers allowed you to do more with the onbeforeunload/onunload events, this could be used pretty maliciously by anybody.

提交回复
热议问题