我在登录页面有一个提交按钮,我想在点击一次后禁用提交按钮。使用this.disabled = true;
语句可以正常工作,并且在禁用按钮后它会转到下一页。但问题在于,当我点击“返回”按钮时,提交按钮仍然被禁用,因为页面没有从服务器重新加载,而是从本地缓存加载。我想在每次回到登录页面时都启用该按钮。我可以清除缓存,但这会导致从服务器重新加载页面,从而使项目变慢。如何才能最好地解决这个问题呢?
<script>
$(document).ready(function(){
$(document).on('click','button',function(){
this.disabled = true
window.location="https://www.google.co.in/"
})
})
</script>
<body>
<button type="submit" id="button">Click Me!</button>
</body>