私のコードでは、two
buttons
があります。ユーザーがいずれかをクリックすると、function
が実行されます(すでに動作しています)。もう一度クリックするとは何もしません。ボタン - いずれかのボタンをクリックして作業を停止する方法
私のHTMLコード:
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
<script src="jquery-3.1.1.js"></script>
<script src="JS.js"></script>
<!--script src="JS2.js"></script-->
</head>
<body>
<p><input type="button" name="click" value="Button I" id="1" onclick="myFunction();"/></p>
<p><input type="button" name="click" value="Button II" id="2" onclick="myFunction2();"/></p>
</body>
</html>
マイ機能コード(.jsファイル):
function myFunction(xx, xx, numberOrigin){
numberOrigin +=1;
$.ajax({
type: 'POST',
dataType: "json",
contentType: "application/json",
url: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
data: JSON.stringify({
"xxxxxxxxxxx":xxxxxxx,
"xxxxxxxxxxxx":xxxxxxxxx,
"xxxxxxxxxxxx":"xxxxxxx"
}),
success:function(output) {
console.log(output);
otherFunction(xxxxxxxxxxxxxxxx, numberOrigin);
},
error:function(output) {
}
});
}
おかげで事前。
のように見えるのでしょうか? – vvtx
ボタンにnbのクリックを保存するためにどのような変数を使用しますか?ボタンの1つがクリックされたのは初めてですか? – PMerlet
関数の最後に 'disable'を実行します –