473,788 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ph p" 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="javasc ript:winexp=win dow.open('http://server2/lookfor.php', ....);
winexp.parent=s elf;" ...

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.f orm1.field1.val ue=fileselected byuser;

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.f orm1.field1.val ue=fileselected byuser; 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 1568
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.ph p" 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="javasc ript:winexp=win dow.open('http://server2/lookfor.php', ....);
winexp.parent=s elf;" ...

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.f orm1.field1.val ue=fileselected byuser;

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.f orm1.field1.val ue=fileselected byuser; 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.n et> a écrit dans le message news:
78************* **************@ msgid.meganewss ervers.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.ph p" 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="javasc ript:winexp=win dow.open('http://server2/lookfor.php', .....); winexp.parent=s elf;" ...

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.f orm1.field1.val ue=fileselected byuser;

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.f orm1.field1.val ue=fileselected byuser; 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
8470
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 it is a VERY difficult process for people used to apple products to handle. Now, to solve the problem, and possibly make it more mainstream, i would like to create a C++ (or java, altho i hate the language, i also know a little about it)...
18
5155
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 observations I've recently made. The core of the problem is that Postgres is filling up my hard drive with swap files at the rate of around 3 to 7 GB per week (that's Gigabytes not Megabytes) . At this rate it takes roughly two months to fill up my 40...
9
5034
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 am generating, a transparent background. On the newsgroups - everyone points to this MSDN article: How to save a .gif file with a new color table by using Visual C# .NET http://support.microsoft.com/default.aspx?scid=kb;en-us;319061 Even...
3
5771
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 drive onto a USB External Hard Drive. I have to assume I also copied the data. I
16
9533
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 sector, cluster, partition, etc. information so I can use it later on to determine if the file was ever deleted and restored or moved elsewhere. Thank you.
13
4881
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 === question 1 Primarily Im trying to design a program that has full control over a hard disk. What it needs to do is find out what sectors haven't been
6
30712
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 serial number would do fine, but on Googling it seems that some of the sample code will now laways work on W2K, and not without administrator rights. Hence my question - how can I consistently get a UNIQUE PC identifier using vb.net 2003 - not...
13
28395
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 this but i didn't find on internet even on maxtor.com the problem is my hdd model is 6V300F0 which isn't listed in maxtor's HDD lists. :(
2
3154
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 clock, 50GB Hard disk) and for the past 10 days i have noticed that my hard disk space is decreasing dramatically without installing or running any programs. I had 28 GB free space 10 days ago on my hard drive and now It has decreased to 17GB...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.