Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  15] [ 3]  / answers: 1 / hits: 21583  / 13 Years ago, sun, february 5, 2012, 12:00:00

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?


More From » javascript

 Answers
31

window.location



The 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.


[#87633] Friday, February 3, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jimmieo

Total Points: 515
Total Questions: 102
Total Answers: 110

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
;