简体   繁体   English

自定义弹出窗口关闭

[英]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?' 我有一个jsp文件。每当用户关闭屏幕时,都会弹出带有自定义消息的弹出窗口,并且应该显示两个自定义按钮(继续和取消)。单击继续按钮,您应该转到另一页。然后单击取消按钮以保留在同一页面上。 ............请帮助我了解如何实现这些目标。.是否有办法更改我收到的默认消息“您确定要离开此页面吗?” and then 'Press OK to continue, or Cancel to stay on the Current page.' 然后“按OK(确定)继续,或按Cancel(取消)停留在当前页面上”。 Can I only display 'my message' in between this two messages? 我只能在这两条消息之间显示“我的消息”吗?

I am using below javascript codes: 我正在使用以下javascript代码:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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