0

I write a some function like abc() and this function call when browser is closed.

Condition is that the method is execute when browser is called not any other event like page reload,navigate etc.

Give me the solution as soon as possible.

Tumbi
  • 3
  • 3

2 Answers2

1

You can't. If it was possible all sorts of annying things would happen. the closest you can get is onBeforeUnload.

Jasen
  • 11,837
  • 2
  • 30
  • 48
0

Try this code:

<script> 
$( window ).unload(function() 
{
   abc(); //your function name 
});
</script>
Ziumin
  • 4,800
  • 1
  • 27
  • 34
Ashutosh
  • 11
  • 4