I need a jquery solution that will trigger a function on a windowClose event.
I currently have:
alert("Page has Closed");
The problem with .unload() is that it's trigger anytime the DOM is unloaded. So every time you click any link on the page, the DOM is unloaded & then reloaded with the new page content. This triggers the closeIt() function.
I need to only trigger the function when the window is closed, or if someone is to leave the domain - so I can make an ajax call & record the log out in the db.