title: How can I execute a script after calling window.location.href?
body: <p>I have a script that redirects the user to another page. I want to load some content into a div on the new page after the new page has fully loaded. How can I do this. The following doesn't work.</p>
  <pre class="lang-js prettyprint-override"><code>function goToPage() {
      window.location.href = 'http://www.mypage.com/info';
      $('.my_class').load('my/url/path/with/content/to/load');
  }
  </code></pre>
  <p>The newly loaded page <code>http://www.mypage.com/info</code> contains the following div:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;my_class&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>What am I doing wrong?</p>