搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Reload button doesnt refresh the page

  • 6 个回答
  • 3 人有此问题
  • 10 次查看
  • 最后回复者为 bradp

more options

Hi, so I started learning to develop websites a while ago, and all was good. However, recently I've had an issue. When I make a change and I'd like to refresh the page, to see it how someone visiting for the first time would see it, the page reloads, however it's exactly the same. For example, I've got 2 buttons. When button 1 clicked, button 2 gets disabled. Refresh the page and... button 2 is still disabled. In other browsers, both buttons return to their "default state". Shift-clicking the reload button does in fact refresh the page as expected. But a normal click, even if the webpage was retrieved from cache, should at least refresh the page, right? I've tried refreshing firefox, so add-ons are not the issue, and this hasn't been an issue before, any help is appreciated.

Hi, so I started learning to develop websites a while ago, and all was good. However, recently I've had an issue. When I make a change and I'd like to refresh the page, to see it how someone visiting for the first time would see it, the page reloads, however it's exactly the same. For example, I've got 2 buttons. When button 1 clicked, button 2 gets disabled. Refresh the page and... button 2 is still disabled. In other browsers, both buttons return to their "default state". Shift-clicking the reload button does in fact refresh the page as expected. But a normal click, even if the webpage was retrieved from cache, should at least refresh the page, right? I've tried refreshing firefox, so add-ons are not the issue, and this hasn't been an issue before, any help is appreciated.

由bradp于修改

被采纳的解决方案

As you have discovered, Firefox may retain and prefill cached form field values and other "page state" when redisplaying a page. I really appreciate that in recent months this site allows that.

If you want a "standard" reload (not holding shift) to default the fields back to their original values and status, you could try preventing Firefox from caching the page -- some developers have said this is difficult because Firefox is rather stubborn about flushing cached pages -- or hook a different event (pageshow) to clear the fields back to default values.

More info in this article: https://developer.mozilla.org/Firefox/Releases/1.5/Using_Firefox_1.5_caching

定位到答案原位置 👍 0

所有回复 (6)

more options

Any suggestions on this?

more options

Update: Still no response :(

more options

So sorry for the wait! Your thread slipped thru us somehow.

I was thinking this was caused by a addon that added web dev options to help you debug your site. But since you refreshed Firefox that can't be the case. Although you may have enabled a developer tool option that could be causing this problem like the disable cache setting. But I'm going to ask Jscher, a contributor with web dev experience to help us out here. I'm hoping he can help us figure out what's going on here.

You can really help us out by sharing the link to your site or making it publicly accessible so that we can try it out ourselves and see what might be wrong. Thanks! Btw what other browsers did you test your site in?

more options

选择的解决方案

As you have discovered, Firefox may retain and prefill cached form field values and other "page state" when redisplaying a page. I really appreciate that in recent months this site allows that.

If you want a "standard" reload (not holding shift) to default the fields back to their original values and status, you could try preventing Firefox from caching the page -- some developers have said this is difficult because Firefox is rather stubborn about flushing cached pages -- or hook a different event (pageshow) to clear the fields back to default values.

More info in this article: https://developer.mozilla.org/Firefox/Releases/1.5/Using_Firefox_1.5_caching

more options

Hi, thanks for the responses https://bradleyphillips.co.uk/uni/example.html Is a basic example of what I'm trying to explain. When the start button is pressed the stop button gets disabled, but on page reload the stop button doesn't get re-enabled. In response to jscher2000, are you saying that I'll have to use javascript to refresh the page state on reload? Unfortunately I don't have time right now to read through the link, but I'll have a look in a few hours. Thanks again for the responses, Brad

more options

So I've just found some time to look through the link, and it seems to explain everything, thanks again, brad