2

You can change a URL like google.com to google.com/test without reloading the page by JavaScript.

Is it possible to completely change the URL like from google.com to Welcom.To.The.Website using the URL bar as a display?

2

Is it possible to completely change the url like from google.com to Welcom.To.The.Website

No, you cannot change the domain (ie. the origin). Presumably you are referring to HTML5's pushState()? From Mozilla Developer help:

The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception.

Apart from being confusing for users. This would also be a security issue. Pretending to be a site you are not - phishing. A website could also trick you into visiting another malicious website just by hitting the back button.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.