• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

how to detect browser close when 'X' clicked

Hi, this is on a internal web app with php/javascript and how could we detect when the browser app is closed when pressed X with javascript. Thanks.
0
nevyana2006
Asked:
nevyana2006
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
window.onbeforeunload = function() {
      return "noooooooo!!!!";
}

test page : http://jsfiddle.net/cfnjmk6L/
0
 
nevyana2006Author Commented:
regret that affects another function
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.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now