Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.26 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to initiate an AJAX call when hash has changed
  2. if(window.location.hash.hasChanged())
  3. {
  4.    // ajax stuff
  5. }
  6. else
  7. {
  8.    // nothing, no hash has been changed (without any window reload)
  9. }
  10.        
  11. window.onhashchange = function() {
  12.    // do something awesome here
  13. };