Given that I\'m on the following page:
http://www.webmail.com/pages/home.aspx
How can I retrieve the host name (\"http://www.webmail.
Depending on your needs, you can use one of the window.location properties.
In your question you are asking about the host, which may be retrieved using window.location.hostname
(e.g. www.example.com
). In your example you are showing something what is called origin, which may be retrieved using window.location.origin
(e.g. http://www.example.com
).
var path = window.location.origin + "/";
//result = "http://localhost:60470/"