Results 1 to 4 of 4

Thread: Javascript populating section on page based on cookies

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Javascript populating section on page based on cookies

    I have a page that uses asp to provide a list of items. I want to create a server side include that when I click on an item it adds the item to a list of cookies, save the list, and then displays the list in another section on this same page in another table.

    I have figured out that javascript can save cookies with out refreshing the page unlike asp. I don't know how I will be able to populate the cookie data into another section of a table. It will be like a chart on the right/left side of a web page that displays all the items I have in my cookie. Do I need to create a form in this table section and then somehow populate it?

    Thanks for any help/advice you give.

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    Why do you want to use cookies to transfer values between different parts of a page? You can better use javascript variables for this. Imo cookies should only be used to store variables across different sessions.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830
    You post a good question. I want to put to a cookie because if they do leave and come back the next time they will have the same selections they had last visit. Plus, I have thought of both session variables and having them sign up to create entries into the database. Session variables take resources from the server so if a large number of users are on then the box takes a hit. Writing to a database could take time depending on the amount of users that I get. Yes, you probaboy are thinking I will never get to the size of say ebay, amazon etc.. but I believe if I can get this to work then it would serve the best for performance.

    So I guess if you have some ideas for me that would be great on how to do this with cookies.

    Thanks.

  4. #4
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    I'm sorry, I've never worked with javascript cookies, and my knowledge about ASP cookies has worn down very much. I can't help you with it.

Posting Permissions

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



Click Here to Expand Forum to Full Width