window.location.href = "www.mysite.com/page2.php"; // Sadly this reloads ' M: [6 O3 |+ r+ D
) E- m l6 y$ e' t3 `. ?; f3 u! i 解决方案: * d& s1 m" r% t* T# b( i+ R 现在可以在 Chrome、Safari、Firefox 4 和 Internet Explorer 10pp4 中完成!2 m! n. Q3 D- }7 b3 D2 P6 `
例子:/ c3 o+ C- e. P0 B+ B0 U
function processAjaxData(response,urlPath){ document.getElementById("content").innerHTML = response.html; document.title = response.pageTitle; window.history.pushState({"html":response.html,"pageTitle":response.pageTitle},"",urlPath); }( }# M. ^+ z7 O5 g4 r1 z