springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 12:04:56
215
我有一个带有“onclick”功能的按钮,可以禁用该按钮15秒。之后,它将自动被点击,但是在点击后的15秒之间,如果我刷新了页面,它将不计算剩余的秒数,按钮现在可以被点击了。
function up(){
$(document).ready(function () {
$("#upside").attr("disabled", true);
document.getElementById("downside").disabled = true;
setTimeout(function () {
$("#upside").removeAttr("disabled");
$("#downside").removeAttr("disabled");
window.location ='/Balnce_add';
},15000);
});
}
下面是我的HTML按钮代码:
function up(){
$(document).ready(function () {
$("#upside").attr("disabled", true);
document.getElementById("downside").disabled = true;
setTimeout(function () {
$("#upside").removeAttr("disabled");
$("#downside").removeAttr("disabled");
window.location ='/Balnce_add';
},15000);
});
}
顺晟科技:
这个想法是保存到。然后当我们重新加载页面时,我们将得到。如果,我们将保留禁用按钮。如果没有,我们什么也不做。
基于这个想法,我更新了您的代码以使其正常工作。您可以通过下面的代码检查演示:
function up(){
$(document).ready(function () {
$("#upside").attr("disabled", true);
document.getElementById("downside").disabled = true;
setTimeout(function () {
$("#upside").removeAttr("disabled");
$("#downside").removeAttr("disabled");
window.location ='/Balnce_add';
},15000);
});
}
此外,您可以在https://codepen.io/tuandaodev/pen/nwgbjbv
查看现场演示这取决于应用程序是如何设置的,但一种简单的方法是在localhost中存储点击按钮的ID。
我写得很快,所以可能有点粗糙,但一般的想法是,当按钮被单击时,将一些内容添加到localstorage中,并在页面加载上检查localstorage,如果按钮被单击后还没有15秒,则禁用它
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11