473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hard to find problem for specialists !

Hello,

Here is a hard problem i cannot solve about window.opener method
I think you'll need to be a specialist to find the solution... i can't find
the solution by myself ! Please help me.
Here is the problem (quiet complicated to explain).

I use two differents servers with two IIS 4.0 Web servers

On the first one (let's name it Server1) i got my web site. On my web site,
i have a page (A.html) that calls (in javascript) a new window that loads a
PHP script that remains on the second server. Are you following me ?

On the second server (let's name it Server2) there is the so-called PHP
script "lookfor.php" that browse the system file of my server (of course i
needed to implement IIS and a virtual web site for it to work).

Let's recapitulate :

So in the A.html page on server1 there is a form (form1) with a field
(filed1) to be filled by an entry selected with lookfor.php. The call to the
script lookfor is done thanks to window.open (below) :

OnClick="javascript:winexp=window.open('http://server2/lookfor.php', ....);
winexp.parent=self;" ...

in the lookfor.php script (resident on Server2) there is a javascript code
as below that should fill field1 on the form1 of the opener window
window.opener.form1.field1.value=fileselectedbyuse r;

AND NOW... THE PROBLEM...

here is the question
When both the page and the script are on the same server, this is running
perfectly but if i use 2 servers as discribed up the field is never filled.
It seems as if window.opener.form1.field1.value=fileselectedbyuse r; makes an
exception a terminate the code (and the field1 is not filled). It also seems
as if the object Windows.opener doesn't exists !

Do you really think that it is a problem of 2 servers ? Is it possible to
make it run ? Did i forget a piece of code ?

Hope i was clear and you'll be able to help me. I can send you the code if
you need it !

Many thanks for yout help
Fabrice

PS : Please excuse my bad english.
Jul 20 '05 #1
2 1544
Fabrice Labrousse wrote:
Hello,

Here is a hard problem i cannot solve about window.opener method
I think you'll need to be a specialist to find the solution... i can't find
the solution by myself ! Please help me.
Here is the problem (quiet complicated to explain).

I use two differents servers with two IIS 4.0 Web servers

On the first one (let's name it Server1) i got my web site. On my web site,
i have a page (A.html) that calls (in javascript) a new window that loads a
PHP script that remains on the second server. Are you following me ?

On the second server (let's name it Server2) there is the so-called PHP
script "lookfor.php" that browse the system file of my server (of course i
needed to implement IIS and a virtual web site for it to work).

Let's recapitulate :

So in the A.html page on server1 there is a form (form1) with a field
(filed1) to be filled by an entry selected with lookfor.php. The call to the
script lookfor is done thanks to window.open (below) :

OnClick="javascript:winexp=window.open('http://server2/lookfor.php', ....);
winexp.parent=self;" ...

in the lookfor.php script (resident on Server2) there is a javascript code
as below that should fill field1 on the form1 of the opener window
window.opener.form1.field1.value=fileselectedbyuse r;

AND NOW... THE PROBLEM...

here is the question
When both the page and the script are on the same server, this is running
perfectly but if i use 2 servers as discribed up the field is never filled.
It seems as if window.opener.form1.field1.value=fileselectedbyuse r; makes an
exception a terminate the code (and the field1 is not filled). It also seems
as if the object Windows.opener doesn't exists !

Do you really think that it is a problem of 2 servers ? Is it possible to
make it run ? Did i forget a piece of code ?


You are running into the Same Source Rule. The windows can only interact
if they were served from the same domain. You can get around it by
putting this in a script in the head of all documents:

document.domain = "common.com"

If you do that, then windows from server1.common.com and
server2.common.com can interact.

http://www.crockford.com/#javascript
Jul 20 '05 #2
Douglas,

thank you very much for your help... i didn't know this method. I ran it
with success. All is important to note is that there mus be a equal suffix
in the domain name for it to work.

Regards.
Fabrice

"Douglas Crockford" <no****@covad.net> a écrit dans le message news:
78***************************@msgid.meganewsserver s.com...
Fabrice Labrousse wrote:
Hello,

Here is a hard problem i cannot solve about window.opener method
I think you'll need to be a specialist to find the solution... i can't find the solution by myself ! Please help me.
Here is the problem (quiet complicated to explain).

I use two differents servers with two IIS 4.0 Web servers

On the first one (let's name it Server1) i got my web site. On my web site, i have a page (A.html) that calls (in javascript) a new window that loads a PHP script that remains on the second server. Are you following me ?

On the second server (let's name it Server2) there is the so-called PHP
script "lookfor.php" that browse the system file of my server (of course i needed to implement IIS and a virtual web site for it to work).

Let's recapitulate :

So in the A.html page on server1 there is a form (form1) with a field
(filed1) to be filled by an entry selected with lookfor.php. The call to the script lookfor is done thanks to window.open (below) :

OnClick="javascript:winexp=window.open('http://server2/lookfor.php', .....); winexp.parent=self;" ...

in the lookfor.php script (resident on Server2) there is a javascript code as below that should fill field1 on the form1 of the opener window
window.opener.form1.field1.value=fileselectedbyuse r;

AND NOW... THE PROBLEM...

here is the question
When both the page and the script are on the same server, this is running perfectly but if i use 2 servers as discribed up the field is never filled. It seems as if window.opener.form1.field1.value=fileselectedbyuse r; makes an exception a terminate the code (and the field1 is not filled). It also seems as if the object Windows.opener doesn't exists !

Do you really think that it is a problem of 2 servers ? Is it possible to make it run ? Did i forget a piece of code ?


You are running into the Same Source Rule. The windows can only interact
if they were served from the same domain. You can get around it by
putting this in a script in the head of all documents:

document.domain = "common.com"

If you do that, then windows from server1.common.com and
server2.common.com can interact.

http://www.crockford.com/#javascript

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Erich Keane | last post by:
Ok, first a quick background: I, along with a small group of diehards came up with a way to disable the EU volume cap protection on the european ipods. Unfortunately, this way never caught on, as...
18
by: Joe Lester | last post by:
This thread was renamed. It used to be: "shared_buffers Question". The old thread kind of died out. I'm hoping to get some more direction by rephrasing the problem, along with some extra...
9
by: RCS | last post by:
I'm working on an ASP.NET webpage that generates an image (and am using VWD 2005 until my copy of VS2005 ships). I have done all the obvious (and not-so-obvious) things to try to give a gif that I...
3
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard...
16
by: Otie | last post by:
Hi, Is there a way for VB5 to determine exactly where on a hard drive a .exe file is stored upon the .exe file's first copying to the hard drive? What I need to know is the exact hard drive...
13
by: ragtag99 | last post by:
I posted this on comp.lang.asm.x86, alt.os.development, comp.arch, comp.lang.c++ Im working with windows xp professional, NTFS and programming with MASM, c++ (free compiler) or visual basic 6.0...
6
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk...
13
usafshah
by: usafshah | last post by:
hi all i'm installing windows xp on Maxtor SATA 300 GB but setup prompts with the error of: setup did not find any hard disk drives.... its showing in bios I tried to download drivers for...
2
by: =?Utf-8?B?R2VvcmR5?= | last post by:
Hello everyone, I would really appreciate if someone helped me in this matter cause I am going to lose my mind... I am using a Sony Vaio Laptop with Windows XP professional (512MB Ram, 1,7 GHz CPU...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.