function check_close(){
if(window.confirm("确定关闭?")){
window.open(新页面);
}else{
return;
}
}
if(window.confirm("确定关闭?")){
window.open(新页面);
}else{
return;
}
}
解决方案 »
- ssh2中表单里实体id无法提交,但是其它属性没问题
- s:iterator 选中一行,跳转到edit页面
- java调用C#写的一个WebService的一个问题----
- 急求一个WEB服务器!
- web 项目中 发送邮件的问题,希望能懂的人帮我解答一下,谢谢
- 框架里的一个页面使用了层(菜单),但层被另外的页面盖住了。
- 谁知道Jbuilder8.0的注册码???
- 能否启动,关闭另一台机器的tomcat.
- 98下设置JSP的安装环境,用什么较好 急!!!
- SSH框架中事务处理的问题,求大家帮忙解决一下!谢谢~~~
- 一个自定义标签的问题,很简单的,就是图形显示不出来,请大家帮我看看,我是各种方法都用尽了,唉(块烦死了)
- 谁会用流读取数据库
就ok了
这个样就可以了~~它一个确定和取消~
public CloseTest(){
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
// setDefaultCloseOperation(EXIT_ON_CLOSE);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.out.println("windowClosing");
// switch(JOptionPane.showConfirmDialog(null,null,"Do you really want to close the frame?",JOptionPane.YES_NO_OPTION)){
switch(JOptionPane.showConfirmDialog(null,"Do you really want to close the frame?","...",
JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)){
case JOptionPane.YES_OPTION:
System.out.println("select yes");
System.out.println("before dispose");
dispose();
System.out.println("after dispose");
break;
case JOptionPane.NO_OPTION:
System.out.println("select no");
break;
default:
}
}
public void windowClosed(WindowEvent e){
System.out.println("windowClosed");
System.exit(0);
}
});
}
public static void main(String[] args){
JFrame f=new CloseTest();
f.setVisible(true);
}
}
confirm("确定关闭?");
window.open("新页面");
</script>
<script language=javascript>
var truthBeTold = window.confirm("单击“确定”继续。单击“取消”停止。");
if (truthBeTold) {
window.open("你的新网页!");
} else window.close(); </script>
window.onbeforeunload = function()
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
if(window.confirm("单击“确定”继续。单击“取消”停止")){
window.open();
}else{
return;
}
}
}
</script>