如果我不知道主机名,有没有办法在没有Javascript /服务器端脚本的情况下链接到同一个盒子上的不同端口号?
例如:
<a href=":8080">Look at the other port</a>
Run Code Online (Sandbox Code Playgroud)
(这个例子不起作用,因为它只会对待:8080作为我要导航到的字符串)
下面的标记会停止指向页面的链接,而无需提供完整的URL:
<a href="foo.html">link</a>
Run Code Online (Sandbox Code Playgroud)
所以,如果你点击它example.com/,你会去example.com/foo.html.有没有办法创建一个链接,example.com:port/foo.html而不是去?