Khargesh Rajput

Khargesh Rajput

  • NA
  • 5.6k
  • 603.6k

popup message on closing browser

Nov 11 2014 3:47 AM
When I am closing my browser I want a confirmation message.
 
 
I am using
 
window.onbeforeunload = confirmExit;
function confirmExit() {
return "You will Lost this test. Are you sure you want to exit this page?";
}
 
But this  function is also working on page postback on my page.
I want this message on window cclose only
What should I have to do.????

Answers (3)