有没有办法告诉Firefox不要记住页面刷新时我的输入字段的状态? [英] Is there a way to tell Firefox not to remember the state of my input fields on page refresh?

查看:190
本文介绍了有没有办法告诉Firefox不要记住页面刷新时我的输入字段的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firefox有一个非常烦人的功能。它记住了当你点击F5时输入字段的状态。这不仅仅是价值,它甚至会记住输入是否被禁用。



示例:

 < html> 
< head>
< script src =https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js>< / script>
< / head>
< body>
< input type =textvalue =textbox/>
< / body>
< / html>

上面的代码有一个锚点,当点击时,禁用文本输入字段。之后,Firefox会记住F5之后的状态,唯一的方法就是将它恢复到原来的地址栏。



是否有meta标签或什么使FF停止这样做?

编辑

行为。 Firefox是最烦人的。 Firefox会记住输入值以及是否禁用。 IE8记住的值,Chrome不记得任何东西

解决方案

您可以设置元素或窗体autocomplete =off禁用状态保存,当然也禁用输入自动完成。


Firefox has a very annoying feature. It remembers the state of input fields when you hit F5. It's not just the value, it remembers even whether the input is disabled or not.

Example:

<html>
    <head>
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
    </head>
    <body>
        <input type="text" value="textbox" />
        <a href="#" onclick="javascript: $('input').attr('disabled', true); return false; " >Disable text box</a>
    </body>
</html>

The code above has an anchor that, when clicked, disables the text input field. After that, Firefox will remember the state after F5 and the only way to restore it to the original is to hit enter on the address bar.

Is there a meta tag or something to make FF stop doing that?

EDIT

Actually browsers have different behaviors. Firefox is the most annoying. Firefox remembers the input value and whether it's disabled or not. IE8 remembers the value and Chrome doesn't remember anything

解决方案

You can set the element or the form to autocomplete="off" to disable state preservation, but that also disables input autocomplete, of course.

这篇关于有没有办法告诉Firefox不要记住页面刷新时我的输入字段的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆