0

How can I pass from this type of url:

http://domain.com

To this type:

http://domain.com/#0123456789

Without reloading the page.

I do not want to use the HTML5 window.history.replaceState function, as it does not work with the older versions of Internet Explorer.

2
  • 2
    the hash link is easy and would work in all browsers. The url replacement is not possible in old browsers. caniuse.com/#search=history I would just fallback on hash links in IE9... Commented Nov 13, 2014 at 0:37
  • http://domain.com/#0123456789 just make this a hyperlink - the page should not be reloaded as it is just a anchor link within the page. Commented Nov 13, 2014 at 0:37

2 Answers 2

1

I found my answer:

location.hash = "0123456789";

Sorry to answer my own question...but no answer gave the right point.

Sign up to request clarification or add additional context in comments.

Comments

0

Like this:

window.location += "/#/123456";
console.log(location.hash);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.