onunload

can i fire JS function using onunload when user closes the browser ONLY ?
(and not if he refresh the page)
10x
LVL 1
eladrAsked:
Who is Participating?
 
lil_puffballConnect With a Mentor Commented:
Try this:

<body onunload="if(self.screenTop>9000){alert('Closed.');}">
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.