开发者

jQuery BBQ, How to detect a repeat click, which doesn't trigger a hashchange

开发者 https://www.devze.com 2023-03-01 10:46 出处:网络
I\'m using the jQuery plugin hashchange: http://benalman.com/projects/jquery-hashchange-plugin/ $(function(){

I'm using the jQuery plugin hashchange: http://benalman.com/projects/jquery-hashchange-plugin/

$(function(){
    $(window).hashchange( function(){
      // location.hash
    })
    $(window).hashchange(); // Trigger the event (useful on page load).
});

This works great the problem is if you click on a link more than once:

<a href="#/p/31"&开发者_开发知识库gt;im a link</a>

the hashchange doesn't refire which I want so that when the user clicks on a link more than once I can refresh the data. Is that possible?

Any ideas on how I can detect a repeat click?

Thanks


Check the hash before you apply it, and/or use a flag.

0

精彩评论

暂无评论...
验证码 换一张
取 消