title: Global variable life in Javascript - destroyed on a reload?
body: <p>(I am learning Javascript)</p>
  
  <p>Problem: A page I am working on has 2 views, a data entry view with a textbox and a data rendering view. There is a <code>a href src="currentpage#"</code> link that switches between the 2 views. In order to transmit data from view to view, the javascript parses it from the current HTML and pushes it into the correct form for the other view. This is <em>ugly</em> and I want to refactor it out, ideally into some sort of global where it can be neatly rendered down into the view on command (I'm refactoring the code base to a point where I can AJAX it from a server).</p>
  
  <p>However, I am not certain about scoping rules and variable life in JS. </p>