title: How to detect if URL has changed after hash in JavaScript
body: <p>How can I check if a URL has changed in JavaScript? For example, websites like GitHub, which use AJAX, will append page information after a # symbol to create a unique URL without reloading the page. What is the best way to detect if this URL changes?</p>
  
  <ul>
  <li>Is the <code>onload</code> event called again?</li>
  <li>Is there an event handler for the URL?</li>
  <li>Or must the URL be checked every second to detect a change?</li>
  </ul>