History.pushState(data,title,url) concatenates (instead of replacing) url to address bar if there is a trailing slash
问题 For example, If I use the search bar from "www.site.com" I see "www.site.com/search", which is fine. If I use the search bar from "www.site.com/events/" I see "www.site.com/events/search", which is silly. Why does it do this? Is this the behavior or a history.js bug or my bug? 回答1: Give an example of what you are doing. If your current URL in the address bar has the form: http://somesite.com/path/ And you pass pushState( null, null, 'newpath' ); in this case, the link will look like http:/