如何避免垃圾邮件/多次点击函数-PHP/LARAVEL
所以我做了一个游戏,在我的游戏中有一个激活部分的项目。因此,他们可能会像垃圾邮件一样多次单击“激活”按钮,这会导致一些错误。你知道我怎样才能避免吗 这个激活部分不像一个提交表单,它就像他们点击它,这个功能工作并激活它。有什么建议我可以做什么 这就是它们激活的方式 php部分的内部是这样的。所以这个点击部分在php中如何避免垃圾邮件/多次点击函数-PHP/LARAVEL,php,jquery,laravel,Php,Jquery,Laravel,所以我做了一个游戏,在我的游戏中有一个激活部分的项目。因此,他们可能会像垃圾邮件一样多次单击“激活”按钮,这会导致一些错误。你知道我怎样才能避免吗 这个激活部分不像一个提交表单,它就像他们点击它,这个功能工作并激活它。有什么建议我可以做什么 这就是它们激活的方式 php部分的内部是这样的。所以这个点击部分在php中 if($idd->is_active == 0){ echo "<a href='/item/activate/".$s."'>Ak
if($idd->is_active == 0){
echo "<a href='/item/activate/".$s."'>Aktifleştir</a>";
}
elseif($idd->is_active == 1){
echo '<a href="/item/de-activate/'.$s.'">Pasifleştir</a>';
}
如果($idd->处于活动状态==0){
回声“;
}
elseif($idd->处于活动状态==1){
回声';
}
这是如何防止jQuery事件多次触发的示例
HTML:
adam你认为即使我的代码在php中,我也能做这个例子吗?我试过了,但它变得非常混乱,可能无法正常工作,你能最小化你的代码吗?考虑到我的激活码很小,而且只有内部代码,你有更多的例子:这是适合我的答案。但你的回答也可能对某些人有所帮助。
<!DOCTYPE html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" id="index">
<div data-theme="a" data-role="header">
<h3>
First Page
</h3>
<a href="#second" class="ui-btn-right">Next</a>
</div>
<div data-role="content">
<a data-role="button" id="test-button">Click me</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
<div data-role="page" id="second">
<div data-theme="a" data-role="header">
<h3>
Second Page
</h3>
<a href="#index" class="ui-btn-left">Back</a>
</div>
<div data-role="content">
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
</body>
</html>
$(document).on('pageinit', '#index', function(){
$(document).on('click', '#test-button',function(e) {
alert('Button click');
});
});