2

I am working on an application. I have opened a Window using

  window.open() 

Now after opening this window, the parent Page is getting Refreshed(Means Page Load is Happening).

Now , How can I set the Focus on the Child Window after the Page load of the Parent Page. Please Help.

4

2 回答 2

0

获取您正在打开的窗口的句柄,并在重新加载父页面后使用该句柄将焦点设置为它。

var popup = window.open(); //open the child window
location.reload(); // reload the parent page
popup.focus();  //set focus on the child window
于 2012-11-08T13:19:28.403 回答
0

将焦点设置在新窗口上。

尝试使用

window.focus()

于 2012-11-08T09:48:52.030 回答