I need some help. I want to change address bar content, but i need replace whole addres including www.site.com/(domain)
I make a try with:
window.history.pushState("object or string", "Title", "new-url");
But without sucess. Please help?
Thanks
I need some help. I want to change address bar content, but i need replace whole addres including www.site.com/(domain)
I make a try with:
window.history.pushState("object or string", "Title", "new-url");
But without sucess. Please help?
Thanks
The history.pushState api only allows you to modify the url within the same origin, which is <scheme> "://" <hostname> [ ":" <port> ]. The pushState api will allow you to modify the path, query parameters, and url fragment. The reason you can't modify the origin is because of the Same-origin Policy, which provides a guarantee that one origin cannot interfere with another origin. The policy exists to provide security guarantees on the web, such as confining malicious JavaScript to a single origin so it can't affect other websites.