Want to achieve web page timing become focus execution

iscjm

Junior Member
Jul 9, 2021
5
0
6
<script>
function confirmDescConfirmIcon(){
$.sendConfirm({

hideHeader: true,

withIcon: true,

hideClose: true,

autoClose: true,

bgHide: false,

escHide: true,

withCenter: true,

button: {

confirm: '确定',

},

onConfirm: function(){

window.open('test.php','','depended=no,height=-200,width=-200,top=2000,left=2000,toolbar=no,menubar=no,scrollbars=no,location=no,status=no');

}
})};
confirmDescConfirmIcon();
</script>

This button page implements "window.open()" to open a new window.
I would like to ask how I can automatically bring the button page to focus if I am browsing another page and the button page is not closed. I don't want to use "window.open" again to bring the button page to focus.
Before, I tried to execute a certain page in the background, and then I wanted to use the "window.location.href" to a page that open a new window of the button page after a period of time, so that the button page becomes the focus of execution, but I failed.
Later I tried a page in the background using "window.location.href" to jump to the button page then the button page automatically become the focus, but failed!
Because I am new for js, trouble a little more detailed, please help me! Thank you very much!
 

mooncancook

Platinum Member
May 28, 2003
2,874
50
91
I think if you assign a name to the window, like `window.open('test.html', 'myTestWindow', 'height=200, width=200')`, then when you call it again, it will bring up the same window. If you don't assign it a name, it will open a new window everytime you call it
 

iscjm

Junior Member
Jul 9, 2021
5
0
6
I think if you assign a name to the window, like `window.open('test.html', 'myTestWindow', 'height=200, width=200')`, then when you call it again, it will bring up the same window. If you don't assign it a name, it will open a new window everytime you call it
  • It doesn't work for me. Anyway, I appreciate your advice very much
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,218
3,796
75
It looks like you're trying to create a pop-under. Don't do that. That's nasty. (Although the link does provide code.)