关闭浏览器可以节省时间 [英] Closing Browser save time

查看:93
本文介绍了关闭浏览器可以节省时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

跟踪用户关闭浏览器但尚未退出应用程序的时间,并将该时间使用带有C#的Asp.net写入数据库中.

track the time the user closed his browser and had not yet signed out of your application and write that time into a database using Asp.net with C#.

推荐答案

您可以尝试使用JS中的window.onbeforeunload事件来调用WebService,但这不能保证正常工作.由于网络是断开连接的媒体,因此无法保证做到这一点,但是onbeforeunload是最好的选择.
You can try using the window.onbeforeunload event in JS to call a WebService but this is not a guaranteed to work. Since the web is a disconnected medium there is no guaranteed way to do this, but onbeforeunload is your best bet.


这篇关于关闭浏览器可以节省时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆