window.focus() not working in Google Chrome

后端 未结 16 1735
余生分开走
余生分开走 2020-11-28 05:07

Just wondering if Google Chrome is going to support window.focus() at some point. When I mean support, I mean have it work. The call to it doesn\'t fail, it jus

16条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 05:33

    you can focus another window by calling open with javascript:; as url parameter:

    window.open('http://....', 'myWindow');
    
    // focus that window later on...
    window.open('javascript:;', 'myWindow');
    

提交回复
热议问题