open new window or tab but keep focus in the current [duplicate]

岁酱吖の 提交于 2020-01-03 04:50:10

问题


I want to open new window or tab, but I want to keep focus in the current window. I currently use the following code :

window.open('/Pages/FilesDownload.aspx?q=' + args._commandArgument, '_blank');

what is the modification I must do to in the code?


回答1:


Try

window.open('/Pages/FilesDownload.aspx?q=' + args._commandArgument, '_blank');
setTimeout(function() { window.focus() },500);


来源:https://stackoverflow.com/questions/34607780/open-new-window-or-tab-but-keep-focus-in-the-current

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!