且构网

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

如何在浏览器关闭事件上执行服务器端代码。

更新时间:2023-11-27 21:56:40

服务器不知道你关闭了浏览器所以你不能这样做。您可以做的***的事情是使用Session End事件,该事件在用户超时时触发(如果他们停止查看您的站点,他们最终会这样做),但这不是很可靠。
The server has no idea you have closed the browser so you can't do this. The best you can do is use the Session End event which fires when the user times out (which they will eventually do if they stop viewing your site) but that's not very reliable.