【发布时间】:2012-03-07 06:32:10
【问题描述】:
在 Javascript 中,我可以像这样重定向和保留查询字符串和片段 ID:
window.location = "NEW_LOCATION" + window.location.search + window.location.hash;
对于没有 Javascript 的网站,您可以使用 http-equiv 元标头。但这会删除查询字符串和片段 ID:
<head>
<meta http-equiv="Refresh" content="300; url=NEW_LOCATION" />
</head>
有没有一种方法可以使用 http-equiv="refresh" 来保留查询字符串和片段 ID?
【问题讨论】:
-
将查询字符串和片段追加到 NEW_LOCATION? NEW_LOCATION#fragment?querystring
-
@Frederik,我不知道它们是什么。用户可以设置它们,我希望它们可以带到新位置。
标签: javascript html redirect