title: Stop Caching Window Object on back reload
body: <p>Let assume page url /xyz. I have window object declared at the top of my JS (because I need that throughout) like </p>
  
  <pre><code>window.myObject={
      someWork:true
  }
  </code></pre>
  
  <p>and I am changing the property value like</p>
  
  <pre><code>if(window.myObject.someWork){
     //Do Work
     window.myObject.someWork=false
  }
  </code></pre>
  
  <p>When I click back button from some other page (abc->xyz) my  <code>window.myObject.someWork</code> remains false instead of getting re-initialised again at the top (because I think refresh will run the script again). Can you please suggest what is happening around and how to fix this.</p>
  
  <p>Went through this <a href="https://stackoverflow.com/questions/2323352/does-back-forward-in-the-browser-change-javascript-variables">Does back/forward in the browser change javascript variables?</a>. Any fix for this? I am using Chrome and would like to make it work on all browsers</p>
  
  <p>Fixed:
  Xufox solution is good and worked.It also cache DOM elements on back button. So make sure its not screwing up the code :) </p>
  
  <p>Thanks in advance</p>