【发布时间】:2010-12-11 22:07:19
【问题描述】:
我有一个问题: 我想通过 JavaScript 重定向到上面的目录。 我的代码:
location.href = (location.href).substr(0, (location.href).lastIndexOf('folder'));
网址如下所示:
example.com/path/folder/index.php?file=abc&test=123&lol=cool
重定向只影响这个:
example.com/path/&test=123&lol=cool
但是想拥有这个:
example.com/path/
我该怎么做?
【问题讨论】:
标签: javascript url redirect