title: Executing Javascript code after loading refreshed page
body: <p>I have a Javascript file that is split into to two parts. The first part of the code ends by refreshing the current page. I would like to try to get the second part of the code to execute as soon as the page reloads, but I am having trouble finding a way to implement this. I pretty much want a way to do </p>
  
  <pre><code>window.onload = someFunction() 
  </code></pre>
  
  <p>except that it activates the function after reloading the page due to the first part of the Javascript. Is there an effective way to do this?</p>