且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当用户点击后退按钮浏览器追踪

更新时间:2023-12-03 10:47:10

有做这件事的多种方式,虽然有些只能在特定的浏览器。一,我知道了我的头顶部是嵌入在页面上一个微小的几乎看不见的iframe中。当用户点击后退按钮iframe要浏览回来,你可以检测到,然后更新您的网页。 这里是另一种解决方案。

There are multiple ways of doing it, though some will only work in certain browsers. One that I know off the top of my head is to embed a tiny near-invisible iframe on the page. When the user hits the back button the iframe is navigated back which you can detect and then update your page. Here is another solution.

您可能还想要去的东西,如Gmail查看源代码,看看他们是怎么做的。

You might also want to go view source on something like gmail and see how they do it.

这里的一个库之类的事情你的方式寻找

Here's a library for the sort of thing you're looking for by the way