我使用了这种方法来导航到url,触发事件并且不将url添加到浏览器历史记录中。但是
Backbone.history.navigate(url,{trigger:true, replace: true})
会替换掉历史记录中之前的url。
例如:浏览器历史记录
之前:
localhost:port/url
Backbone.history.navigate(url + '/list',{ trigger:true, replace: true })
预期结果:在路由url + '/list'
上触发事件,并且浏览器历史记录为 localhost:port/url
实际结果:事件被触发,但浏览器历史记录变成了localhost:port/#url/list
。之前的url被替换了。
#
吗?这个问题不是很清楚。 - fearphage