繁体   English   中英

在JavaScript中隐藏或最小化窗口

[英]Hide or minimize window in javascript

我在vb.net环境中有一个脚本代码,该脚本代码从路径中调用文件,但是当我调用该文件时,窗口保持打开状态,所以我想将其隐藏。 我的代码在下面

ClientScript.RegisterStartupScript(Me.GetType(), "openfile", String.Format("window.open('/Reports/September Sowing Report Area-1/September Sowing Report Area-1 {0}.ods');", DD4.SelectedValue), True)

在JavaScript代码中打开另一个窗口后,尝试将焦点设置回主窗口。

例如:

 window.open( .... ); self.focus();

另外,您也许可以使用blur方法:

var newWindow = window.open( ... );
newWindow.blur();

让我知道这是否适合您。 行为可能取决于浏览器...

暂无
暂无

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

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