I have a website on a host example.myhost.com
but I also have a sub-domain for French fr.example.myhost.com which is different than example.myhost.com.
If I’m at fr.example.myhost.com and I use window.location.href, I get example.myhost.com instead of fr.example.myhost.com.
How do I get the URL typed in the address bar of the browser?
window.locationThe subdomain shouldn’t make a difference. If, however, you’ve typed the URL in the address bar, after the page has loaded (but not hit enter), then that’s a different story altogether.