且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Silverlight 4的:检测浏览器F5 /刷新和X /关闭

更新时间:2023-10-26 21:53:28

,因为它是不可能在客户端,我做到了在服务器端。

since it is not possible in client side, i did it in server side.

我解决这个使用code我的问题:

I solve my problem using this code:

window.onunload = function (e) {
        // Firefox || IE
        e = e || window.event;
        var y = e.pageY || e.clientY;

        if (y < 0) {
            alert("close");
        }
        else {
            alert("refresh");
        }
    }