var data = e.target.getAttribute('data-name'),
url = data + ".html";
history.pushState(null, null, url);
// here we can fix the current classes
// and update text with the data variable
// and make an Ajax request for the .content element
// finally we can manually update the document’s title
1条答案
按热度按时间slhcrj9b1#
这可以通过历史api来完成。
来源:https://css-tricks.com/using-the-html5-history-api/