Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每当我在不重新加载页面的情况下进行 ajax 查询时,我都希望更新浏览器 url,这样人们就可以轻松地转到 url 并通过 url 查询查看生成的页面。使用jQuery。
if (typeof (window.history.pushState) == 'function') { window.history.pushState({ "html": response.html, "pageTitle": response.pageTitle }, "", urlPath); } else { window.location.hash = '#!' + urlPath; }
但是 IE 不支持 Url PushState 所以你可以使用 '#' 后跟你的 Url