This will create a popup msg when the user leaves the page. Change MESSAGE GOES HERE! into the msg you want to have displayed!

Click the code to select, press CTRL+C to copy and CTRL+V to paste at the wanted location.