Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q377 How can I access the value of a variable set on a different page - when I have to go through an intermidate page first?

You are here: irt.org | FAQ | JavaScript | Link | Q377 [ previous next ]

Use a frameset with a hidden frame:

<FRAMESET ROWS="100,*">
<FRAME SRC=page1.htm">
<FRAME SRC="blank.htm">
</FRAMESET>

Store the variable in the parent frame:

<SCRIPT LANGUAGE="JavaScript"><!--
var myname='me';
parent.myname = myname;
//--></SCRIPT>

When the 2nd page is loaded access the variable in the parent frame.

<SCRIPT LANGUAGE="JavaScript"><!--
var myname = parent.myname;
//--></SCRIPT>

©2018 Martin Webb