//关闭当前页面,并且打开新页面,(不提示) function closeWinAndOpen(url) { var sWinName = "LR"+parseInt(Math.random() * 100000000);//利用随机数处理WinName window.open(url,sWinName, ‘toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes‘); closeWin(); } //关闭当前页面 function closeWin() { window.opener=null; window.open(‘‘,‘_self‘); window.close(); } 关闭父页面: Response.Write("<script>window.top.opener=null;window.parent.close();</script>") (window.top.close() 也好使) 设置window.opener=null 可以不显示:"您查看的网页正在试图关闭窗口,是否关闭窗口"
时间: 2024-11-08 22:18:16