javascript onbeforeunload custom message 33 Javascript Onbeforeunload Custom Message Definition and Usage. The onbeforeunload event occurs when the document is about to be unloaded. This event allows you to d… Written By Anonymous Saturday, February 21, 2015 Add Comment Edit