我们都熟悉相对路径:./images/hello.jpg从http://www.domain.com/hey链接到的相对路径http://www.domain.com/hey/images/hello.jpg.
问题:你如何说明你到达http://www.domain.com:1234时的相对路径http://www.domain.com/hey?
下面的标记会停止指向页面的链接,而无需提供完整的URL:
<a href="foo.html">link</a>
Run Code Online (Sandbox Code Playgroud)
所以,如果你点击它example.com/,你会去example.com/foo.html.有没有办法创建一个链接,example.com:port/foo.html而不是去?