Email conversation
From | Michael Pohrebnyak |
To | Me |
Subject | Problem with SSL / JavaScript working with two windows |
Date | 17 September 2004 10:31 |
Dear Sir,
first of all i'd like to thank you for such a wonderful and informative
site.
i have a next problem: i'm using ssl (https protocol). From one window i
open next one and try to make
opener.some_form.some_field.value = this.document.some_form.some_field.value
it works, but not with https. it says that area is protected or something
like that.
of course i could make a form and reload these two pages with varibles
needed. But pages are two big and every time it takes a while to reload
those.
Could you please help me with this problem. hopfully can i work with
ssl / javascript between two windows.
Thanks one more time,
Sincerelly,
Michael Pohrebnyak
From | Me |
To | Michael Pohrebnyak |
Subject | Re: Problem with SSL / JavaScript working with two windows |
Date | 17 September 2004 11:52 |
Michael,
JavaScript should work between two windows, whether you are using SSL or
not. I have tested this for you in Opera, IE, Netscape 4, Mozilla, Safari,
IE Mac, Konqueror - etc. etc. you name it, it works.
Anyway, there are some situations where it will fail.
- Secure pages cannot communicate with insecure pages. Either both must be
secure or both must be insecure.
- Pages on one server cannot communicate with pages on another server.
- Pages served on one port cannot communicate with pages on another port.
Any of these would be a security violation (IE allows the third one). Are
you doing any of these?
As a separate point, opener points to the window object of the opening
window, not the document object, so this script is not valid:
opener.some_form.some_field.value = this.document.some_form.some_field.value
you should use:
opener.document.some_form.some_field.value = etc.
(I assume you are already doing this correctly in your real code)
Hope this helps
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Michael Pohrebnyak |
To | Me |
Subject | Re: Problem with SSL / JavaScript working with two windows |
Date | 17 September 2004 15:49 |
Mark,
it still shows the line number referencing code text and massege 'error:
Permission denied'.
The opener.document.some_form.some_field.value = etc. makes no difference
for IE.
> - Secure pages cannot communicate with insecure pages. Either both must
> be secure or both must be insecure.
I have two secured pages!
>- Pages on one server cannot communicate with pages on another server.
One server!
> - Pages served on one port cannot communicate with pages on another port.
Not sure. I need to check the port. But it seems to me that they are the
same. Why shoud be they different?
Could you tell me more about it. How than can i open the window on the same
port as a opener?
Thanks a lot for a response!
Michael
From | Me |
To | Michael Pohrebnyak |
Subject | Re: Problem with SSL / JavaScript working with two windows |
Date | 17 September 2004 16:59 |
Michael,
> it still shows the line number referencing code text and massege 'error:
Permission denied'.
'Permission denied' means that your script is trying to do something that
is a security violation.
> The opener.document.some_form.some_field.value = etc. makes no difference
for IE.
I did not think it would. Just wanted it to be valid to make sure :)
> I have two secured pages!
> One server!
> I need to check the port.
Unless you specially chose for them to be different, they will not be
different. To use different ports, you would need to do this:
https://blah.com:8000/
If you have not done this, then they will probably be using the same port
(443 for SSL HTTPS - with TLS HTTPS, this could actually be any port, but
usually uses the same port as HTTP -> 80)
If the second page was actually opened by the first, it should work. The
page must be opened using window.open, _not_ target="_blank"
If it helps, I have an example on
http://myTestServerAddress.com/onewindow.html
(this is not my server so I can only leave the page there for about 1 week)
Type something in the box, and click 'test'. A new window should open and
it should tell you what you wrote in the box on the first page. This works
in everything I have tested in.
Tarquin
From | Michael Pohrebnyak |
To | Me |
Subject | Re: Problem with SSL / JavaScript working with two windows |
Date | 17 September 2004 22:45 |
Hi,
well, you are right. it works independenly on https or http. the problem
was, that i transport one link through couple of pages a few times. And it
should be done directly.
Well, i've found the problem with your help. :)))
I have one more question. :(
i have windows xp. there i have apache, mysql, php etc. as a webserver.
sometimes it happens that the page restarts itself a couple of times and
than looses the connection at all.
could you tell me what can it be, without me to reinstall the windows. i've
tested with other computers. it works without problems.
thanks a lot one more time!
Michael
From | Me |
To | Michael Pohrebnyak |
Subject | Re: Problem with SSL / JavaScript working with two windows |
Date | 18 September 2004 00:13 |
> Well, i've found the problem with your help. :)))
:) this is good to hear
> I have one more question. :(
> i have windows xp. there i have apache, mysql, php etc. as a webserver.
> sometimes it happens that the page restarts itself a couple of times and
> than looses the connection at all.
:( sorry, I run Apache on Linux and Netware, and I have never seen this problem.
However, the Apache site has a mailing list that should be able to help:
http://httpd.apache.org/lists.html#http-users
The lists are also available in German
Tarquin