I am looking for something like below (jQuery OnUserExit
plugin):
http://archive.plugins.jquery.com/project/onUserExit
but as you see their web site is not working.
So where can I find that plugin or how can I write something like that with jQuery?
Please see this thread: Counting online users using asp.net
I need that plugin for fire Session_End
in global.asax
. -> referring to link upper answers.
So the code below is not useful for OnlineUsers Count(fire Session_End in global.asax
):
<script type ="text/javascript" >
function CloseWindow()
{
alert("You are closing the window.Fire Session_End using EndSession.ashx");
}
window.onunload=CloseWindow;
</script>
because when user has two or more of a web site open these function will remove that user from OnlineUsers by closing one of them.
but looking for a function that recognize all open browsers of that web site and fire by closing last one (others are close
).
EDIT After Comments:
there are some web sites out there that can handel the other web sites online usesrs count with javascript.
how do these web sites work and how do they recognize OnUserExit.
for example one of their codes in my web site is like this :
document.write('<script language="javascript" src="http://www.Counter.com/c.aspx?t=stats&code=2562977&ref=' + escape(document.referrer) + '"></script>'); screensize=screen.width+'x'+screen.height;colors=(navigator.appName.indexOf('Microsoft')==0)?screen.colorDepth:screen.pixelDepth;if(colors=='undefined'){colors='5';};if(colors=='32'){colors='1';};if(colors=='24'){colors='2';};if(colors=='16'){colors='3';};if(colors=='8'){colors='4';};document.write ('<div align="center"><iframe scrolling=no width=125 height=110 border=0 frameborder=0 allowtransparency="true" src="http://engine.Counter.com/counter/xstat.aspx?t=sum1&code=2562977&rnd=' + Math.round(Math.random()*50000) + '&s=' + screensize + '&c=' + colors + '&ref=' + escape(document.referrer) + '&title=' + escape(document.title) + '" ></iframe></div>');
would you please give us some explain about these codes!
thanks in advance