-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added betting and AJAX for player hit/stay and dealer next
- Loading branch information
Showing
12 changed files
with
291 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
$(document).ready(function(){ | ||
player_hit(); | ||
player_stay(); | ||
dealer_hit(); | ||
}); | ||
|
||
function player_hit() { | ||
$(document).on("click", "form#player_hit_form input", function() { | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/player/game/hit' | ||
}).done(function(msg){ | ||
$("div#play_game").replaceWith(msg); | ||
}); | ||
return false; | ||
}); | ||
} | ||
|
||
function player_stay() { | ||
$(document).on("click", "form#player_stay_form input", function() { | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/player/game/stay' | ||
}).done(function(msg){ | ||
$("div#play_game").replaceWith(msg); | ||
}); | ||
return false; | ||
}); | ||
} | ||
|
||
function dealer_hit() { | ||
$(document).on("click", "form#dealer_hit_form input", function() { | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/dealer/game/hit' | ||
}).done(function(msg){ | ||
$("div#play_game").replaceWith(msg); | ||
}); | ||
return false; | ||
}); | ||
} |
Binary file not shown.
Oops, something went wrong.