Forum Moderators: open
I'm not aware of any way to tell the difference between a refresh and a site exit using javascript. However, if you are tracking users across multiple pages, looking at the timestamps of visits should allow you to set a reasonable window of time between page loads as meaning either "they were still on the site" or "they left and came back."
You could also add some kind of polling to your javascript to basically ping the server every couple minutes if they still have the page open.
HTH :)