On - [removed].hash - Change?

后端 未结 13 1349
谎友^
谎友^ 2020-11-21 13:38

I am using Ajax and hash for navigation.

Is there a way to check if the window.location.hash changed like this?

http://example.com/blah

13条回答
  •  再見小時候
    2020-11-21 13:43

    Ben Alman has a great jQuery plugin for dealing with this: http://benalman.com/projects/jquery-hashchange-plugin/

    If you're not using jQuery it may be an interesting reference to dissect.

提交回复
热议问题