From: me on
"me" <me(a)example.com> wrote in message news:QCK4o.6$Y21.1(a)hurricane...
> The window.opener doesn't seem to work as expected in Chrome; it points to
> the main window (I can use window.opener.close() to close the main window)
> but I cannot access the global variable. I tried
> window.opener.getAttribute("MyVar") but that doesn't work either.

Apparently there are 2 alternative syntaxes:
1. window.opener.MyVar
2. window.opener.window.MyVar
Both seem to work in IE7 and FF (I can't test other browsers right now)
Is version 2 more correct/standard-compliant/cross-browser-supported ?

Marc.


From: me on
"me" <me(a)example.com> wrote in message news:VsM4o.13$VW2.2(a)hurricane...
> Apparently there are 2 alternative syntaxes:
> 1. window.opener.MyVar
> 2. window.opener.window.MyVar
> Both seem to work in IE7 and FF (I can't test other browsers right now)
> Is version 2 more correct/standard-compliant/cross-browser-supported ?

Apparently "window" has a property "window"... You can keep adding
..window.window.window and it should make no difference; so the above is
probably not a fix for the window.opener.MyVar problem in Chrome.

Marc.


From: Ry Nohryb on
On Jul 31, 6:35 am, "me" <m...(a)example.com> wrote:
> "me" <m...(a)example.com> wrote in messagenews:VsM4o.13$VW2.2(a)hurricane...
> > Apparently there are 2 alternative syntaxes:
> > 1. window.opener.MyVar
> > 2. window.opener.window.MyVar
> > Both seem to work in IE7 and FF (I can't test other browsers right now)
> > Is version 2 more correct/standard-compliant/cross-browser-supported ?
>
> Apparently "window" has a property "window"... You can keep adding
> .window.window.window and it should make no difference; so the above is
> probably not a fix for the window.opener.MyVar problem in Chrome.

k= 27;
--> 27

window.open("").opener.k
--> 27
--
Jorge.
From: me on

"David Mark" <dmark.cinsoft(a)gmail.com> wrote in message
news:9177d0b1-a4a4-4238-8ea0-ff4cdf673546(a)y12g2000prb.googlegroups.com...
On Jul 30, 9:05 pm, "me" <m...(a)example.com> wrote:
>> The window.opener doesn't seem to work as expected in Chrome; it points
>> to
>> the main window (I can use window.opener.close() to close the main
>> window)
>> but I cannot access the global variable. I tried
>> window.opener.getAttribute("MyVar") but that doesn't work either.
>
>What makes you think it would? Guessing rarely leads to solutions.

Well, as I understand it, but correct me if I'm wrong, declaring a global
variable MyVar = x
is the same as window.MyVar = x. But maybe I'm confusing properties and
attributes.

>>It's not a cross-domain security issue either.
>
>Are you sure?

I was testing it with local files on my computer. I haven't put this online
yet.

>> Anyone have any idea what's going on ?
>
>No as you have not provided nearly enough information.

Sorry about that; I thought it would be something simple and silly that
would be
obvious to users in this group. I'll get back to the list with more details.

Marc.


From: David Mark on
On Jul 31, 7:56 am, "me" <m...(a)example.com> wrote:
> "David Mark" <dmark.cins...(a)gmail.com> wrote in message
>
> news:9177d0b1-a4a4-4238-8ea0-ff4cdf673546(a)y12g2000prb.googlegroups.com...
> On Jul 30, 9:05 pm, "me" <m...(a)example.com> wrote:
>
> >> The window.opener doesn't seem to work as expected in Chrome; it points
> >> to
> >> the main window (I can use window.opener.close() to close the main
> >> window)
> >> but I cannot access the global variable. I tried
> >> window.opener.getAttribute("MyVar") but that doesn't work either.
>
> >What makes you think it would?  Guessing rarely leads to solutions.
>
> Well, as I understand it, but correct me if I'm wrong, declaring a global
> variable MyVar = x
> is the same as window.MyVar = x.

You are wrong. It may have the same effect in some browsers, but
certainly not in all.

> But maybe I'm confusing properties and
> attributes.

No. You are confusing declaring variables with adding a property to a
host object. The two concepts aren't even in the same league.

>
> >>It's not a cross-domain security issue either.
>
> >Are you sure?
>
> I was testing it with local files on my computer.

And that could well account for the discrepancy.

> I haven't put this online
> yet.

Do so and see if the behavior changes.

>
> >> Anyone have any idea what's going on ?
>
> >No as you have not provided nearly enough information.
>
> Sorry about that; I thought it would be something simple and silly that
> would be
> obvious to users in this group.

Testing pop-up windows with local security restrictions is not a
common activity for most developers.

> I'll get back to the list with more details.
>

It's not a list.