By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,527 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,527 IT Pros & Developers. It's quick & easy.

Use of the same variable on multiple pages

P: n/a
Hi

How do I transfer a variable on one page to another page?

example:

page1.htm
<script language="JavaScript">
var t = 1;
</script>

page2.htm
<script language="JavaScript">
here I want to use the variable t
</script>

is this possible at all, or what can I do instead. It is for use on a CD
/Danny

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello

This can be done, you have to transfer this variable as a parameter of the
next page and then parse it back from the next page.

That is:
page1.htm will pass 'i' to page2.htm this can be done as:
1)page1.htm will forward to page2.htm?i=123
2)in page2.htm you would parse the location.search and fetch 'i' back again

regards,
Elias
"Danny Poulsen" <da***********@nospam.email.dk> wrote in message
news:bj**********@news.cybercity.dk...
Hi

How do I transfer a variable on one page to another page?

example:

page1.htm
<script language="JavaScript">
var t = 1;
</script>

page2.htm
<script language="JavaScript">
here I want to use the variable t
</script>

is this possible at all, or what can I do instead. It is for use on a CD
/Danny

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.