我有一个问题。 我想通过JavaScript重定向到上面的一个目录。 我的代码。
location.href = (location.href).substr(0, (location.href).lastIndexOf('folder'));
URL看起来像这样。
example.com/path/folder/index.php?file=abc&test=123&lol=cool
重定向的影响只是这样。
example.com/path/&test=123&lol=cool
但是想有这样的效果。
example.com/path/
我怎样才能做到这一点?