declaring global variables in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swapnarani29
    New Member
    • Aug 2006
    • 1

    #1

    declaring global variables in javascript

    how can i decalre global variables in javascript so that the value which is held by global variable is carried to and fro between html pages to display some items based upon the value in the global variable.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You can't, javascript variables are local to the age they are on.

    What you can do is

    pass variables using a cookie to store them

    pass variables on the URL for the next page to pick up (either by manually writting the URL or through form submission).

    Comment

    Working...