定义和用法
close() 方法用于关闭浏览器窗口。
语法
window.close()
实例
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<title>关闭窗口</title>
<script>
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>这是'我的窗口'</p>");
}
function closeWin()
{
myWindow.close();
}
</script>
</head>
<body>
<input type="button" value="打开我的窗口" onclick="openWin()"/>
<input type="button" value="关闭我的窗口" onclick="closeWin()"/>
</body>
</html>
相关推荐
window.close(),一看就知道是用来关闭浏览器窗口的方法。W3CSchool对该方法的解释如下:方法 close() 将关闭有 window 指定的顶层浏览器窗口。某个窗口可以通过调用 self.close() 或只调用 close() 来关闭其自身...
window plugin with declarative configuration and hash tracking. data-remodal-action="cancel" class="remodal-cancel">Cancel data-remodal-action="confirm" class="remodal-...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
% Main GUI window for speech toolboxes in Childers' Speech book % This GUI window is designed to run in the Matlab runtime server % mode. From this window the user can call any of the software % ...
在IE7、IE8中,使用JavaScript提供的close()方法都可以关闭当前窗口或标签,但都提示讨厌的对话框,找了下代码,终于可以无提示直接关闭了。 JavaScript代码 代码如下:function CloseWin() { window.opener=null;...
dev_close_window ( : : : ) 关闭活跃的图形窗口。 read_image ( : Image : FileName : ) ;加载图片 get_image_pointer1 ( Image : : : Pointer, Type, Width, Height ) ;获得图像的数据。如:类型(= ' 字节',...
第一种: 代码如下:Response.Write(“[removed]window.close();[removed]”);// 会弹出对话框询问是否关闭 第二种: 代码如下:Response.Write(“[removed]window.opener=null;window.close();[removed]”);// 不会...
看下这个弹出窗口中写的函数或许你就明白了: 代码如下:function goIt(obj_id,obj_name) { window.opener.document.forms[“myForm”].elements[“form_plant_shu”].value... window.close(); return false; }
?... if ($b1) { if (is_user_exits($fromname) and check_user_password($fromname,$password)) { ...input type="button" value=" 关闭窗口 " name="B1" onclick="window.close()"></form>"; } else { $f
window.close();” value=”IE6最简单的无提示关闭窗口” > 2、防止被人iframe if (top.location != self.location) { top.location.href=”http://www.34do.net”; } 3、判断一个对象存在不存在 document....
window对象是JavaScript客户层次结构的最顶层对象, form元素和全部JavaScript代码都是存在于文档中,而文档被装载进窗口. 为了理解窗口怎样工作,你可以控制操作这些窗口. 打开和关闭窗口 当用户启动(launch)...
或者依次打开我的电脑->卸载或更改程序->卸载你所卸载的软件,您可以用 Window XP控制面板中的添加或删除程序功能,或用 Windows Vista、Windows 7中的程序和功能删除Synthesia, 然后点击开始卸载,按步骤依次点击...
搜索发现,可以这样解决:[removed] function closeWindow() { window.open(”,’_parent’,”); window.close(); } [removed] <a>Close Window 好多朋友用到是自动关闭页面代码 [removed]function closeWindow...
为了保留原有的alert和confirm方法,我们不直接替换window对象的alert和confirm,而是新建一个win对象,该对象下有alert、confirm、open、close等。win.alert等的对话框弹出层,使用iframe作底层,确保对话框在ie7...
window.close() 系统对话框: 1.alert(“hello world!”); 2.confirm(“Are you sure?”);—选择 3.prompt(“你的名字是说明?”,””); 时间间隔 setTimeout(“alert(‘hello world!’...
通过javascript 实现 ...下载文件 ####### ... [removed] if (typeof(window.opener) != ‘undefined’) //判断 打开方式的下载。 去掉会一打开文件就弹出下载框 { document.... window.close(); } [removed]