【发布时间】:2017-05-23 09:52:52
【问题描述】:
我正在尝试使用ajax 调用将数据插入数据库
我的问题是当我点击按钮两次时,数据会存储两次
这让我感到恶心。如何避免?
<from><button id ="GdStartTest"> </button></form>
$("#GdStartTest").click(function(){
$.ajax({
url: "gdcontroller.php",
method: "POST",
还有这个控制器:
$studentQuery = $conn->query("INSERT INTO r_job_scores
【问题讨论】:
-
$("#GdStartTest").click(function(e){e.stopPropagation();... rest of the code -
bind event only once的可能重复
-
大声笑:“让我恶心”
标签: javascript php jquery ajax button