Q:

How to show confirm box like StackOverflow's confirmation box? 

Ask a question, and while editing the body of your question, click on some link on the page.  StackOverflow's script knows that you are not finished yet, and warns you about loosing your unsaved data.  However, it's confirmation box is not a jQuery plugin, or anything like that.  It seems that its confirmation box is browser-specific box, something like JavaScript's confirm box.  To prove it, simply check it in many browsers and you see different UI styles. 
How they've done it?  Which JavaScript command? 

A:

The onbeforeunload Javascript event is what you're looking for.