Use of the same variable on multiple pages

D

Danny Poulsen

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
 
L

lallous

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top