我怎样才能使href上层目录上升

时间:2015-06-07 09:42:30

标签: html dom href

我在网址中有一个html页面:http://localhost:63343/x/html_pages/http_failures_table/http_failures_table_agg_bl.html

href

<a href="../http_failures_dict/http_failures_dict_bl_0.txt">

但是当我点击我直接指向的网址时

http://localhost:63343/x/html_pages/http_failures_dict/http_failures_dict_bl_0.txt

而不是

http://localhost:63343/x/http_failures_dict/http_failures_dict_bl_0.txt

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您可以返回两个目录级别而不是一个:

<a href="../../http_failures_dict/http_failures_dict_bl_0.txt">

或从 root 开始:

<a href="/x/http_failures_dict/http_failures_dict_bl_0.txt">