473,385 Members | 1,925 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,385 software developers and data experts.

Passing parameters between windows

Hello
My problem is this

Window 1:
newWin = window.open("http://1.1.1.1/....","winName",...);
This opens a new window from a server

function displayResp(obj)
{
var x = obj.var1;
}
This gives access to a variable updated by the server window

Server window:
function respObj()
{
this.var1 = 1;
}
newWin.displayResp(respObj);

This declares a new object respObj with a member var1

The problem:
I need to display var1 in window 1 but the server window does not recognize
newWin


Can someone tell me what I'm doing wrong? How can I fix it?
Feb 12 '07 #1
5 2524
acoder
16,027 Expert Mod 8TB
Welcome to The Scripts!

Use window.opener. See this page.
Feb 12 '07 #2
Welcome to The Scripts!

Use window.opener. See this page.
10x for the reply

opener does not help me because Window1 is opened on my local pc and Server window contains a page from the server. Window1 is from domain A and Server window is from domain B and you cannot update parameters between them.

I also tried to change the server window to contain a form and submit it with action="window1". The problem with that is that it opens a new "window1" alogn with the first one and I need the data to be in the first window1

I'm desperate
Feb 13 '07 #3
Hello

My problem is this

I have a mainWin.html that has two frames (nav and content)

mainWin and its frame are on my local pc and run from there

content frame is used to display pages and let a user set parameters and display results

For example one of the pages I run in content is called a.html, which lets the user select something and when clicking on a button it opens a new window (window.open(http://1.1.1.1,...). The new window is from a remote machine (different domain then my pc)

Because mainWin.html and the server page run from different domains I cannot update content directly with the information from the server page

So ...

The server page looks something like

<BODY ONLOAD="javascript:form1.submit()">
<FORM NAME="form1" ACTION="a.html" TARGET="content">
<INPUT TYPE="HIDDEN" NAME="resp" VALUE="1">
</FORM>
</BODY>

This gives me a.html in the content frame but location.search is empty. I expected it to be ?resp=1

If the server page does not have the TARGET part then a new a.html is opened with the expected location.search

Can someone help and tell me how I can do that?

10x in advance
Feb 13 '07 #4
Hello
My problem is this

Window 1:
newWin = window.open("http://1.1.1.1/....","winName",...);
This opens a new window from a server

function displayResp(obj)
{
var x = obj.var1;
}
This gives access to a variable updated by the server window

Server window:
function respObj()
{
this.var1 = 1;
}
newWin.displayResp(respObj);

This declares a new object respObj with a member var1

The problem:
I need to display var1 in window 1 but the server window does not recognize
newWin


Can someone tell me what I'm doing wrong? How can I fix it?
try the following for Server window:
function respObj()
{
this.var1 = 1;
}
theObj = eval (new respObj());
newWin.displayResp(theObj);
Feb 23 '07 #5
acoder
16,027 Expert Mod 8TB
Hello
My problem is this

Window 1:
newWin = window.open("http://1.1.1.1/....","winName",...);
This opens a new window from a server

function displayResp(obj)
{
var x = obj.var1;
}
This gives access to a variable updated by the server window

Server window:
function respObj()
{
this.var1 = 1;
}
newWin.displayResp(respObj);

This declares a new object respObj with a member var1

The problem:
I need to display var1 in window 1 but the server window does not recognize
newWin


Can someone tell me what I'm doing wrong? How can I fix it?
newWin is declared in window1, so use newWin which will give you access to the object. From that, you should be able to access the variable.
Feb 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
12
by: Joel | last post by:
Hi all, Forgive me if I've expressed the subject line ill. What I'm trying to do is to call a c++ function given the following: a. A function name. This would be used to fetch a list of...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
0
by: Neelima Godugu | last post by:
Hi All, I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar with the security settings requirement inorder to do the above. I have...
3
by: tshad | last post by:
I need to pass a few parameters to my Windows Service program. The end user will be changing the parameters and settings should be saved. What is the best practice - use app.config - use .ini...
2
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New...
3
by: ajaymohank | last post by:
hello everyone..... i am ajay and i am new to php. in my project i have an option to invoke a bat file by passing parrameters and to diplay the result. i tried this code but my page got hung or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.