Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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?

irt.org | Knowledge Base | JavaScript | Link | Q377 [ previous next ]

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?

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.