locked
How to avoid reload from web when navigating back the pages in JavaScript?

    Question

  • I designed an app which load some web stuff in first page. In second page, user can click button to navigate back to first page. At this moment, I don't want to reload the pages from web becaue it takes some time. How can I do it? Basically, I need the similar functionliaty of what browser has with is regard.

     

    Great Wall

    Wednesday, November 7, 2012 7:52 PM

Answers

  • Hi,

    You could have a try with local storage to store the page status(first load or others).

    For example:

    if (localStorage.flag)
      {
      localStorage.flag=1;
      blah,blah...
      }
    else
      {
      blah,blah...
      }


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Tuesday, November 13, 2012 6:54 AM
    Thursday, November 8, 2012 8:34 AM
  • In addtion to the above point, I assume, your browser caches the request and unless your request url has got some kind of seed in the query string it doesn't actually hits the service...I may be wrong and would like to get validated as well....

    Arindam Basu

    • Marked as answer by Song Tian Tuesday, November 13, 2012 6:54 AM
    Friday, November 9, 2012 5:05 AM

All replies

  • Hi,

    You could have a try with local storage to store the page status(first load or others).

    For example:

    if (localStorage.flag)
      {
      localStorage.flag=1;
      blah,blah...
      }
    else
      {
      blah,blah...
      }


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Tuesday, November 13, 2012 6:54 AM
    Thursday, November 8, 2012 8:34 AM
  • In addtion to the above point, I assume, your browser caches the request and unless your request url has got some kind of seed in the query string it doesn't actually hits the service...I may be wrong and would like to get validated as well....

    Arindam Basu

    • Marked as answer by Song Tian Tuesday, November 13, 2012 6:54 AM
    Friday, November 9, 2012 5:05 AM