How to show confirm when browser window got closed or navigated to another website in JS
<p>As the title says ....</p>

<p>Sorry that some ppl got question wrong...</p>

<p>I want to show confirmation on these cases only:</p>

<p>1.Browser window is closed.</p>

<p>2.There is a redirect <strong>to different domain</strong></p>

<p>thanks</p>
