Exit Pop-up window that appears when the user tries to close the tabs or browser or press back button
<p>I need an Exit Pop window that appears when the user tries to exit a page like:
<a href="http://www.mydomain.com/popup.php" rel="nofollow">http://www.mydomain.com/popup.php</a>
if they try and back out of the page or close it, they should get the Exit pop up.Pop up box must contain with an image.
If that case I have used this code segment.</p>

<pre><code>window.onbeforeunload = function(){
  return 'Are you sure you want to leave?';
};
</code></pre>

<p>But I want to add an image in pop up box. Is there a way to do that?</p>
