Maintaining JavaScript array values

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Maintaining JavaScript array values

    Is it possible to maintain the values in an array when my users jump from one
    page to another, and then return to the first page?

    I've created a "portfolio" page with a grid of thumbnails. Click a thumbnail
    and, along with the full-size image appearing, the thumbnail changes color to
    denote that the image has been viewed. The function I've written works, but I
    can't figure out how to maintain the values in the array I've set up and test
    against to determine whether the checked or unchecked thumbnail should be
    displayed.

    I think the array is reinitializing each time a visitor returns to the page.
    Is there a way around this?

    TIA for any help,

    Andrew

    Andigo Guest

  2. Similar Questions and Discussions

    1. Passing JavaScript values
      I've created a JavaScript that totals a column of numbers input by a site visitor. Is there a way to bring that information with me when I jump to a...
    2. insert values in an array
      Hy all, I like to insert a value in an array but only want to renumber the ones after the inserted value like this; situation 1)...
    3. Deleting same values from an array
      Hello, I have an array called $stems that has a bunch of numbers in it like 2, 5, 4, 4, 2, 6, 8. What I want to do is delete a section of the...
    4. asp: values in array not in order??
      I have a form on an asp page and am trying to write the code to place the values of all checkboxes that have been selected, into an array. The...
    5. Random Array values
      Hi, I have an array like so. <?php $movies = array(); $movies = "blue.html"; $movies = "red.html"; $movies = "green.html"; $movies =...
  3. #2

    Default Re: Maintaining JavaScript array values

    You're right in saying that the array reinitalises each time. In fact, I
    don't think it's possible to save anything JavaScript between page views
    natively.

    However, all is not lost. It would be simple to do using cookies set in
    JavaScript, and slightly less simple but still doable (if you don't fancy
    cookies) to pass the info in the URL using a server side scripting language
    such as PHP.

    Rob


    Andigo wrote:
    > Is it possible to maintain the values in an array when my users jump
    > from one page to another, and then return to the first page?
    >
    > I've created a "portfolio" page with a grid of thumbnails. Click a
    > thumbnail and, along with the full-size image appearing, the
    > thumbnail changes color to denote that the image has been viewed.
    > The function I've written works, but I can't figure out how to
    > maintain the values in the array I've set up and test against to
    > determine whether the checked or unchecked thumbnail should be
    > displayed.
    >
    > I think the array is reinitializing each time a visitor returns to
    > the page. Is there a way around this?
    >
    > TIA for any help,
    >
    > Andrew

    rob :: digitalburn Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139