简体   繁体   中英

custom popup on window close

i have a jsp file .whenever user closes the screen a pop up with custom message and two custom buttons ( continue and cancel ) should appear .by clicking continue button u should go to another page .and cancel button to stay on the same page .......plz help me out how cud these be achieved .. Is there a way to change default message I am getting 'Are you sure you want to navigate away from this page?' and then 'Press OK to continue, or Cancel to stay on the Current page.' Can I only display 'my message' in between this two messages?

I am using below javascript codes:

<script type="text/javascript">
function beforeClose()
{
return "my mssage...";
}
window.onbeforeunload=beforeClose;
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM