Results 1 to 2 of 2

Thread: Some Help with Cookies

  1. #1
    Join Date
    Mar 2008
    Posts
    9
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Some Help with Cookies

    Hello there.

    I am refurnishing my website and I have everything in a frameset document. The problem with this is that when someone hits the "refresh" button, the frameset reverts to its default page. This is quite an inconvenience, and is actually rather annoying. So my question is how can I set up a cookie that makes it so my website doesn't revert on refresh.

    But alas, that would be too easy. See, with a cookie like that, every time you visited my site, it would automatically got to the page you were last at. And when you're visiting a site, you don't want that! You want the homepage!

    I am sure that this is actually not that hard of a challenge, but I am quite a novice when it comes to scripting and was wondering if you guys could help me out.

    Thanks in advance!
    -Anon

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default Very Possible...

    This is possible to even do without cookies! In the <body> tag itself of the pages you want to stay at and not revert to the original state, input the following event handler: onbeforeunload="window.location.href='(this_document's_name).html'". This should take care of everything. Although you would need to replace "(this_document's_name)" with the actual document name. I really do hope this helps with everything.

    -magicyte

    -------------------------------
    "Don't judge a program by its appearance,
    but by its code.
    "

    -Magicyte

    [http://magicyte.freehostia.com/]

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
  •