Search the blog

Here is what a sample window.location object looks like in JavaScript. This is useful for taking action based on the current URL.

{
    "href": "https://www.domain.com:80.local/path/?foo=bar",
    "origin": "https://www.domain.com",
    "protocol": "https:",
    "host": "www.domain.com:80",
    "hostname": "www.domain.com",
    "port": "80",
    "pathname": "/path/",
    "search": "?foo=bar",
    "hash": "#foo"
}
Tim Bennett is a web designer and developer. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.