標籤:
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title>HTML5無刷修改url - 瓊台部落格</title> <script type="text/javascript"> function changeURL(){ var url = document.getElementById(‘url‘).value; window.history.pushState({},0,‘http://‘+window.location.host+‘/‘+url); } </script> </head> <body> <h1>html5無重新整理改變url</h1> <div id="info" style="margin:30px 0;"> 頁面真真實位址: <span style="color:red;"><script type="text/javascript">document.write(window.location.href);</script></span> </div> <div> 請輸入要改變地URL字串:<input id=‘url‘ type="text" /> <button onclick="changeURL();">點擊無刷改變url</button> </div> <div style="color:red;margin-top:30px;">請使用支援html5的瀏覽器訪問</div> <div style="margin-top:30px;"><a href="http://www.qttc.net/201303292.html" target="_blank">《html5無重新整理改變URL》</a> - 瓊台部落格</div> </body> </html>
http://www.qttc.net/201303292.html
無重新整理URL 更新