Use of the same variable on multiple pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny Poulsen

    #1

    Use of the same variable on multiple pages

    Hi

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

    example:

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

    page2.htm
    <script language="JavaS cript">
    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



  • lallous

    #2
    Re: Use of the same variable on multiple pages

    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" <danny.poulsen@ nospam.email.dk > wrote in message
    news:bjaa76$i60 $1@news.cyberci ty.dk...[color=blue]
    > Hi
    >
    > How do I transfer a variable on one page to another page?
    >
    > example:
    >
    > page1.htm
    > <script language="JavaS cript">
    > var t = 1;
    > </script>
    >
    > page2.htm
    > <script language="JavaS cript">
    > 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
    >
    >
    >[/color]


    Comment

    Working...