Javascript caching

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TimSki
    New Member
    • Jan 2008
    • 83

    Javascript caching

    Hi,

    I have a link on an asp page. When i click the link i call some javascript which changes the appearance of the page using css style.display. If i then leave this page and then come back to it immediately the css style changes are not "saved".

    I'm assuming this is because as far as the browser is concerned the cached version of the page has not changed so it just shows the original version again ?

    Is there anyway to get js to update the cached page or pehaps this is simply not a good design...??

    Thanks for any help.

    Tim
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Any 'changes' you make that involve DHTML/DOM will not be 'saved'.

    One way of retaining this information is to use cookies, so when a change is made, set the cookie. When you come back to the page, if the cookie exists, set the style.display accordingly, otherwise leave as the default.

    Comment

    Working...