How to save the state of the webpage in jquery?

Posted on 2010-01-08
Last Modified: 2012-05-08
Basically I want to be a able to save the state of my webpage. foe example when I go to my webpage and then I go to the about page and I hit the refresh button it stays on the about page and doesn't go back to the home page. I am using jquery to go to each page or technically its just another section on that page.
Here is a link:
I have also added the files.


Question by:askurat1
    LVL 11

    Expert Comment

    You could just have your js set a cookie on each click, and when the document loads, check to see if the cookie is set, retrieve the value, and use that to switch the menu.
    LVL 8

    Author Comment

    Do you maybe have an example of this? This was also what I was thinking but not quite sure how to implement it.

    LVL 2

    Accepted Solution

    thats because you are not using hash as the parameter in scrollTo plugin

                target: '#content', // could be a selector or a jQuery object too.
                hash: false,
                easing: 'easeOutExpo',
                onAfter: trigger

    change hash: true

    this way it will work when you click refresh later, since you have the code for that already to handle hashed link call
    LVL 8

    Author Closing Comment

    Thank you! That works perfect.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now