javascript - Modify the URL without reloading the page -
Can there any way that I modify the URL of the current page without reloading the page?
I want to use part #hash before if possible.
I just need to change the after portion of the domain, so this is not my choice I am violating cross-domain policies.
window.location.href = "www.mysite.com/page2.php"; // Now it can be done in Chrome, Safari, FF4 +, and then reloads it
and IE10pp4 +!
For more information, see the answer to this question:
Example:
function process predicts (response, urlPath) {document.getElementById ("Content "). InnerHTML = response.html; Document.title = response.pageTitle; Window.history.pushState ({"html": response.html, "pageTitle": response.pageTitle}, "", urlPath); } You can use window.onpopstate to detect backward / forward button navigation:
window .onpopstate = function (e) {if (estate) {document.getElementById ("content"). InnerHTML = e.state.html; Document.title = e.state.pageTitle; }}; To view browser history more deeply in tampering.
Comments
Post a Comment