title: How can I trigger on URL change in jQuery?
body: <p>How can I trigger a function when the URL changes? I try something like:</p>
  
  <pre><code>$(windows.location).change(function(){
     //execute code
  });
  </code></pre>
  
  <p>So my URL is something like <code>http://www.mysite.com/index.html#/page/1</code>. How can I execute jQuery or JavaScript code when the URL becomes something like <code>http://www.mysite.com/index.html#/page/2</code>?</p>