本文介绍了如何在Chrome中关注opener窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不能在Chrome中使用焦点开启器窗口...

示例1.

 背后弹出式窗口= window.open(的 'http://google.com','asdf','width=800,height=800'); 
popunder.blur();
popunder.opener.window.focus();

示例2

 背后弹出式窗口= window.open(的 'http://google.com','asdf','width=800,height=800'); 
popunder.blur();

x = popunder.window.open('about:blank');
x.close();

popunder.opener.window.focus();

示例3.

 背后弹出式窗口= window.open(的 'http://google.com','asdf','width=800,height=800'); 
popunder.blur();
window.focus();

示例...依此类推。



有人知道一个解决方案可行吗?

解决方案

目前在Chrome中工作的唯一解决方案是新窗口中的代码:

  $(。closeBtn)。click(function(e)
{
window.open (,window.opener.name);
});

不幸的是,该解决方案仅适用于两种情况:




  • window.opener 必须在文档加载时设置它的名称( window.name =WhateverName;

  • window.open()在用户点击时调用


Focus opener window not working in Chrome...

Example 1.

popunder=window.open('http://google.com','asdf','width=800,height=800');
popunder.blur();
popunder.opener.window.focus();

Example 2.

popunder=window.open('http://google.com','asdf','width=800,height=800');
popunder.blur();

x = popunder.window.open('about:blank');
x.close();

popunder.opener.window.focus();

Example 3.

popunder=window.open('http://google.com','asdf','width=800,height=800');
popunder.blur();
window.focus();

Example ... and so on.

Does anyone know a solution that works?

解决方案

The only solution that currently works in Chrome is this code inside new window:

$(".closeBtn").click( function(e) 
{
    window.open("",window.opener.name);
});

Unfortunately the solution only works under two conditions:

  • window.opener has to have it's name set on document load (window.name="WhateverName";)
  • window.open() is called on user click

这篇关于如何在Chrome中关注opener窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:58