Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  51] [ 5]  / answers: 1 / hits: 32151  / 13 Years ago, fri, july 1, 2011, 12:00:00

They both seem to give me the same thing (the domain name currently executing the script).



So what's the difference (if any) and where should each be used?


More From » javascript

 Answers
6

MDN Web Docs - window.location



host....: the host name and port number. [www.google.com]:80

hostname: the host name (without the port number or square brackets). www.google.com


[#91398] Thursday, June 30, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
debras

Total Points: 307
Total Questions: 98
Total Answers: 112

Location: Maldives
Member since Tue, Dec 21, 2021
3 Years ago
;