【问题标题】:history.js remove query parameters from urlhistory.js 从 url 中删除查询参数
【发布时间】:2013-04-18 15:27:13
【问题描述】:

我正在为我的 ajax 网站使用 history.js。我无法意识到的一件事是如何使用 History.pushState 将 url 从 http://mysite/default.aspx?myparam=paramvalue 更改为 http://mysite/?

如何去掉default.aspx?myparam=paramvalue?

我试过 `History.pushState('','','/');它不起作用

谢谢小伙伴们

【问题讨论】:

    标签: url-rewriting history.js html5-history


    【解决方案1】:

    您是否尝试过使用 History.pushState('','','/');但将http://mysite/ 作为您的第三个函数输入(路径参数)。

    例如History.pushState('ajax','title','http://mysite/');。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-31
      • 2017-11-22
      • 2019-04-25
      • 2018-01-16
      • 1970-01-01
      • 2013-10-21
      • 1970-01-01
      相关资源
      最近更新 更多