/ Published in: JavaScript
//You cannot change the whole url without redirecting, what you can do instead is change the hash.
//The hash is the part of the url that goes after the # symbol.
//That was initially intended to direct you (locally) to sections of your HTML document, but you can read and modify it through javascript to use it somewhat like a global variable.
//The hash is the part of the url that goes after the # symbol.
//That was initially intended to direct you (locally) to sections of your HTML document, but you can read and modify it through javascript to use it somewhat like a global variable.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
document.location.hash = "show_picture";
URL: http://stackoverflow.com/questions/6478485/jquery-change-the-url-address-without-redirecting