Show warning message with OK button before close window in Java Script
<p>I know that by using this function in java script:</p>

<pre><code>window.onbeforeunload = function(e) {
return 'Please press the Logout button to logout.';
};
</code></pre>

<p>It will show the warning message when I press the close window button. But the warning message will ask user to choose between 'stay on the page' or 'leave the page'. </p>

<p>I don't want the user to choose when close window. How do we create the warning message with just OK button?</p>
