I\'m using window.onbeforeunload to pop up a confirm dialog when a close event occurs, but the confirm dialog appears on page refresh and doesn\'t execute on pa
window.onbeforeunload
Since you anyway only want to display your text, What just using the onbeforeunload as it is expected just return the string?