Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  • Thread Tools
  • Rate This Thread
  1. #1
    New to the CF scene
    Join Date
    Nov 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Declare a Global Variable in JS? Need One variable used on multi-pages

    Hello All,

    Is there a way to have a variable declared on one page, and then have that variable and value available for use on a different page/next page, without having to declare it again?

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    8,131
    Thanks
    3
    Thanked 814 Times in 803 Posts
    No - you need to use cookies or local storage to pass information between pages.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  3. #3
    New to the CF scene
    Join Date
    Nov 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Felgall.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •