【发布时间】:2014-09-23 16:26:24
【问题描述】:
我的文档的head 中有以下标签:
<base href="/some/folder/">。
假设我的网站位于http://example.com。一个链接,像这样:
<a href="foo/bar/">...</a>
页面将解析为http://example.com/some/folder/foo/bar/。
但是,像这样的链接:
<a href="/">...</a>
当我真正希望它指向 http://example.com/some/folder/ 时,将解析为 http://example.com。
在这种情况下,我如何创建指向我的应用程序基础的链接而不在任何地方硬编码http://example.com?
【问题讨论】:
-
使用
<a href="./">成功了!