title: How to redirect to and call a script from another page
body: <p>Is there a way to redirect to a url in javascript and specify, at the beginning of this other page, that another script should be executed after the page has finished loading?</p>
  
  <p>I was thinking of something along the lines of:</p>
  
  <pre><code>&lt;a href="/to/other/page"&gt;
  </code></pre>
  
  <p>Then, on the other page, it would execute this function:</p>
  
  <pre><code>function myFunction () {
      //do something
  }
  </code></pre>
  
  <p>However, this function wouldn't be called when visiting <code>/to/other/page</code> normally, but only when redirected from the given link.</p>
  
  <p>I tried a lot of things, but everything said that script behind the redirect isn't done anymore. I can't find a way to send the new script to the redirected page.</p>