Write powerful, clean and maintainable JavaScript. RRP $11.95 JavaScript location.host vs location.hostname example for this domain address https://jquery4u.com location.host gives us jquery4u.com location.hostname gives us jquery4u.com You may be wondering, whats the difference? Well host takes into consideration any specific ports also! Try it below! Check out this awesome site below. source: ht