I am using the window location method to redirect a webpage to another after a set amount of time.
The url needs to change from http://www.myurl.com/home to http://www.myurl.com/other. The problem is that I do not know what the final URLs will be so I cannot use absolute links, they have to be a path only. This is what I have so far:
window.location.pathname = "mobility.html"
You can just prepend a
/to your URL to make them relative to the domain root (without having to hardcode the domain name). Like this: