Track Internet Explorer close forcibly by user
-
hello, I want to track / or want to excecute some function (javascript/server side) when any user try to close the Internet Explorer window forcibly. i tried so many googling..... but didn't get any desire result..
Amit Agarwal
-
hello, I want to track / or want to excecute some function (javascript/server side) when any user try to close the Internet Explorer window forcibly. i tried so many googling..... but didn't get any desire result..
Amit Agarwal
It is really not good to track the browser close event. You can do that using :
if(window.event.clientX < 0 && window.event.clientY <0)
{
// your code
}Call this Method From Body Unload. But it wont do when user forcibly close the browser. If the user normally close using
, Alt+F4 , File -> Closeit will run your code. But if the user ends the process from TaskManager... So I strongly suggest you not to track browser close. Rather track Session Timeout in the server.. If not your requirement really needed this.:cool:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
It is really not good to track the browser close event. You can do that using :
if(window.event.clientX < 0 && window.event.clientY <0)
{
// your code
}Call this Method From Body Unload. But it wont do when user forcibly close the browser. If the user normally close using
, Alt+F4 , File -> Closeit will run your code. But if the user ends the process from TaskManager... So I strongly suggest you not to track browser close. Rather track Session Timeout in the server.. If not your requirement really needed this.:cool:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using JavascriptThanks for your valuable suggestion, code and time. actually my requirement is to create a Audit trail for User Login and Logout. if user login to the system, then i make a entry into the Database. if user successfully Logout to the system then i make the logout entry in the database. but what will happen if user close the IE directly with logout to the system or Alt + f4 or close IE by right click or any thing else. that is my actual requirement..
Amit Agarwal