所以我有一个页面,通过单击更改网站正文中显示内容的选项卡进行导航,当您转到新选项卡(在站点中)时,它会更改 url。例如,我在主页选项卡中,网址更改为 https://a.website.com/home
,然后我转到更改日志选项卡,网址更改为 https://a.website.com/changelog
。这些 url 中没有一个实际存在,那么当用户重新加载它们时,我将如何将它们定向到 https://a.website.com
,而不是一个页面未找到错误页面?
可能使用 window.onbeforeunload
?
答案 0 :(得分:1)
标记正在用作页面参数的选项卡:
https://a.website.com?tab=home
https://a.website.com?tab=changelog
然后,您可以决定在您的页面上显示哪个标签。