title: How to run function after press F5 (refresh)?
body: <p>I tried to make some script that handle with event like "panel changes follow by URLhash". I had no problem with event on button or link but I had problem when I refreshed the page. My panel couldn't keep its values and automatically reset.</p>
  
  <p>And I tried to solve refresh problem like this:</p>
  
  <pre><code>&lt;script&gt;
  document.addEventListener('keydown', function(e) {
      if(e.which == 116) {
          window.alert("1234");
          var id = window.location.hash;
          changePanel(id);
      }
  }, false);
  &lt;/script&gt;
  </code></pre>
  
  <p>As code I shown you, <code>alert()</code> function it was working, but <code>changePanel()</code>  wasn't working. I think because <code>alert()</code> had ran before refreshed and <code>changePanel()</code> also. But in case of <code>changePanel()</code> it ran before refresh then after refreshed all changes are reset to default.</p>
  
  <p>How to run <code>changePanel()</code> after refresh?</p>