We are all familiar with relative paths: A relative path to ./images/hello.jpg
from http://www.domain.com/hey
links to http://www.domain.com/hey/images/hello.jpg
.
Problem: How do you state a relative path to http://www.domain.com:1234
when you are at http://www.domain.com/hey
?
This can be achieved using JavaScript by setting the window.location.port
property.
<a href="#" onclick="javascript:window.location.port=8080">go</a>