JavaScript On Close of window in IE8

前端 未结 3 1563
忘了有多久
忘了有多久 2020-12-20 02:07

I have implemented some function when the browser will be closed.

window.onbeforeunload = function (evt) {

    evt = (evt)? evt:event;
    clickY = evt.clie         


        
3条回答
  •  长情又很酷
    2020-12-20 02:45

    The guy in this thread says that his approach based on the onbeforeunload event works in IE.

    IMHO, however, your best (and cross-platform) chance to do what you want is to setup a Ajax polling request (here is a nice demo) to check how much time has passed since the last user activity and clear the cache accordingly.

提交回复
热议问题