Reputation: 20232
I tried to redirect to www.google.com
like this:
window.location.replace('www.google.com');
However, it does not work. But If I use http
or https
then it works:
window.location.replace('http://www.google.com');
But since not every site supports https I always have to insert http
to make sure the redirect works for sure.
Upvotes: 0
Views: 53
Reputation: 3020
Use urls without protocol:
window.location.replace('//www.google.com');
Upvotes: 2