views:

903

answers:

3

From a child popup window (opened using window.open), I am trying to change the URL of the window that opened me, e.g.

window.opener.location.href = 'http://www.google.com';

In all browsers this works wonderfully, except for IE8 (and I am somewhat sure it worked in previous IE8. Maybe a security update kills this).

In IE8 what happens is that the line above is treated as a request to open a NEW window with the address and the original opener window stays the same. And, since I am not putting this line inside an onclick event, this is treated as a popup.

So how do I do this in IE8? How do I change the opener location?

A: 

try this: on the opener window define a function called goto ;-)

function goto(url){ window.location.href = url; }

now from the child window call window.opener.goto(url);

Tzury Bar Yochay
Unfortunately, I have no control over the opener window (it's bestbuy,com and other retailers), and even if I had, they are in a different domain than myself, so I believe I can't call any method in the opener window.
giltayar
+1  A: 

It looks like this is just not possible. I got no answer from anybody and all my research indicated that this is just another way MS added to block popups.

giltayar
Then that's plain silly.
Faruz
A: 

This is really suck that MS always changes the behaviour of IE in diff version.

Henry