简体   繁体   中英

Hide or minimize window in javascript

I have a script code in vb.net environment which is calling file from path but when i call the file the window remain opened i want to hide it. My code is bellow

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)

Try setting the focus back to the main window after opening the other one in the JavaScript code.

For example:

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

Also, you might be able to use the blur method:

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

Let me know if this works for you. Behavior might depend a bit on the browser...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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