为当前网站中访问的最后一页创建链接吗?
如何创建一个链接到最后访问的页面(该页面是当前网站的一部分)?
另一种说法是,我需要一个类似于浏览器后退按钮的链接,除非最后访问的页面是不同的网站。如果是这种情况,链接可以转到当前访问站点的最后一页,也可以使用任意备份。
更新。 javascript 是最简单的解决方案吗?下面的代码用作后退按钮: [返回]
那么,如果最后一个页面是当前站点的一部分,我是否可以添加一些逻辑使其正常工作,并在访问的最后一个页面不是来自我的站点时提供备份? 谢谢
How can I make a link which goes to the last page visited which was part of the current site?
Another way of saying this is, I need a link which is like the browser back button, unless the last page visited was a different website. If this is the case the link could either go to the last page on the current site that was visited, or an arbitrary back up could be used.
UPDATE. Would javascript be the easiest solution? The code below works as a back button:
[Go Back]
So, could I add some logic that made it work as normal if the last page was part of the current site, and provided a back up if the last page visited wasn't from my site?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样的东西应该可以工作,但是您需要更多的逻辑来处理第一次访问,并且我不确定
request_uri
返回链接所需的确切格式:Something like this should work, but you'll need more logic to handle the first visit, and I'm not sure if
request_uri
returns the exact format you need for the link:NeXXeuS 在这里提出了一个 jQuery 解决方案:
Javascript / jQuery 后退按钮 - 只要最后一页是当前网站的一部分?
谢谢
NeXXeuS came up with a jQuery solution here:
Javascript / jQuery back button - so long as last page was part of current site?
Thanks