SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Build a dynamic function and store them in a cookie

    Hi there,

    I'm not sure how possible this is - so I would to know if it is at all!

    I have a number of scripts i have written for my site - to show/hide layers etc.

    What i would like to do is have them maintain state, so if the user refreshes or comes back to the page later - then the page is as they left it.

    The only way i can think of doing this is building a dynamic function in a cookie and pulling that out so it runs the "compiled" script onLoad.

    Does anybody know if this can be done? Or another way? Or maybe there's already an existing function thats a much simpler solution that i haven't discovered.

    Thanks for any help, this one has me well and truly stumped so far.
    Help - I'm a noob!!

  2. #2
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For maintaining state, it is better to program it on the server side using any server side programming language like jsp,php etc

  3. #3
    SitePoint Addict NikoB's Avatar
    Join Date
    Nov 2005
    Location
    Austria
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can store scripts in a cookie (and then execute then with eval), but not on runtime. You can however story values in a cookie, so why dont you just store the state of the layers/etc in a cookie and read that on the onload?
    Corinis OpenSource Community & Content Management
    http://www.corinis.org


Bookmarks

Posting Permissions

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