问题
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