0
私はcsgo500.comというサイトの拡張機能を作成しています。私のスクリプトには、勝つか失うかによって始まる機能があります。私はコンソールに直接それを置くとき機能が動作しますが、私はそれだけで私に語っ拡張としてそれを作るとき:スクリプトがページjsで応答しない
Uncaught ReferenceError: winner is not defined
私のコードは次のようになります。私は他のをチェックして
var winlose = function() {
if (winner.choice === 0) {
document.getElementById('bet-btn-min').click();
document.getElementById('bet-btn-10').click();
}
else {
document.getElementById('bet-btn-double').click();
}
}
このサイトでは「定義されていません」という説明はありますが、私と同じ種類の問題はありません。 ご意見やご要望はありますか?
編集: 勝者のようにサイトのjsファイル内で宣言されている:私は終わった何
: 「
function generateRound(data) {
lastRound = round;
round = data.round;
winner = data.winner;
numberBets = 0;
$wheelTimer.show();
あなたの勝者はどこで宣言されていますか? – shriek
まだ宣言されていません。 'var winner;'のようなものでなければなりません。 – shriek
新しいアップデート@shriek –