【问题标题】:change the look of the hash in the hashchange plugin在 hashchange 插件中更改哈希的外观
【发布时间】:2012-09-07 03:18:05
【问题描述】:

我目前正在使用http://benalman.com/projects/jquery-hashchange-plugin/,我注意到我的哈希显示为“/#page”而不是“/#/page”我试图从 jQuery 地址复制外观。但是我不能使用 Asual 的原因是它没有像 hashchange 插件那样的触发事件。

当前设置:

$j(window).bind('hashchange', function(e) { 
   run w/e functions here
});

load json objects

$(window).trigger('hashchange');

我注意到在 jQuery 地址中有一个点击选择器的返回。也许我需要这样的东西?

【问题讨论】:

    标签: jquery hashchange jquery-address


    【解决方案1】:

    url中多余的/没什么特别的。

    像往常一样把它放在锚中:<a href="#/page">

    或者手动设置哈希时:location.hash="/page"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多