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

Pass infor between web pages in the same window

Hi,

I want to supply the previous page in current window with a string from
current page and the content in the previous one is changed
accordingly. I use <DIV> innerHTML to accomplish the DHTML and run
below JS in current page when deciding to go back.

window.history.go(-1);
document.getElementById('ObjA').innerHTML='my string';

But the "document" still refers to current page, even though I add a
document.clear() and location.replace() statements right after
window.history.go(-1).

I find the archieve of this Group mentions a few solutions for a
similar problem, however they don't seems to work for my scenario.

The first solutin is to append the string to the previous URL. But my
first page was actually loaded from a HTML file and there is no CGI
program to receive the string.

The second solution is to use cookie to pass the infor. It seems the
string is to saved in the "document" object though. Since the
"document" is not updated, I won't be better off. Another problem is
this solution requires cookie to be turned on in the browser.

The third one is to use frame, which is not desirable nowadays if I am
not wrong.

Any input is appreciated.

Thanks,
Zhigao

Nov 2 '05 #1
2 1221
if you were in your child document and wanted to access an element in
the parent doc you could use:

self.opener.addToForm('test');

this passes "test" to a function called addToForm that is in the parent
document.

self.opener.document.myform.elements['myelement'].value='test';

adds "test" to a element called "myelement" in the form called "myform"

Hope that helps some.

Nov 2 '05 #2
Thanks for the reply. But I am afraid "window.opener" refers to the
main window of a pop-up window. What I am dealing with is, however, two
documents in one window.

Nov 4 '05 #3

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

Similar topics

0
by: Matt | last post by:
My problem is to allow ASP to interact with JSP, and I pass JavaScript object in my approach, but I wonder if it will work in network, not just in local machine. For testing purposes, the...
0
by: iffy agbim | last post by:
I have a form that displays information selected from an Access Data base. A select statement is used to do this on my asp page SQLQuery = "SELECT * FROM tblopgaCOm2 WHERE billNo = '" &...
7
by: Andy Fish | last post by:
Hi, I have a javascript solution where page A launches page B in a second window and then they can pass data between them. That's all well and good. Now say page B wants to navigate to page C...
1
by: TErnst | last post by:
Hello All.... What I am attempting to do is have a link/button on a page (testpopup.cfm) that opens a popup page (popupwindow.cfm). The popup page displays a resultset from a query and the...
4
by: news-server.tampabay.rr.com | last post by:
Hi, Below is a stock script I found which controls a framed environment. My problem is that if a URL has a query string attached, that string does not pass through. Can someone please let me...
23
by: John | last post by:
Last year, I remember finding a web page describing how to pass the name of a file to another web page, and have that web page load that image file. Now, I can't find my record of that (it was...
2
by: lanem | last post by:
I want to pop open a new window from my asp.net 2.0 web page. I want it to pass or submit the current viewstate to the new window. Does anyone know how to do that? Thanks.
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.