javascript: how to reference previous page?

SONYFX

Senior member
May 14, 2003
403
0
0

If a user clicks a link and a pop up show up, I can refer to the parent by "window.opener", what if there's no popup? (the link just go to the net page)
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Nope, the old document no longer exists when you replace it.

window.opener works because the parent still exists at the same time.

To get info from a previous page you must pass it to the next page in the URL or in a form POST and use a script language for the new page.
 

SONYFX

Senior member
May 14, 2003
403
0
0
Originally posted by: DaveSimmons
Nope, the old document no longer exists when you replace it.

window.opener works because the parent still exists at the same time.

To get info from a previous page you must pass it to the next page in the URL or in a form POST and use a script language for the new page.

M problem is that in my form I have div tags that hides certain elements, and when user clicks on certain radio button, the hidden elements will show. Now when user submits the form to the next page, there will be a back button, but if I just use "history.go(-1)" the hidden element will still be hidden(that is, the state of the original page is lost)