Last active
January 7, 2016 20:41
-
-
Save ConnorMcF/6e9d08e1d163d4d4b303 to your computer and use it in GitHub Desktop.
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
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script> | |
function endgame(thename, finalscore) { | |
$.post( "http://hampus.connormcf.com/leaderboard/score.php?name=MYNAME&score=1", { name: thename, score: finalscore }) | |
.done(function( data ) { | |
if(data == "true") { | |
// success! | |
} else { | |
// FAILED! :O | |
} | |
}); | |
} | |
</script> |
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
<script> | |
var whatone = 1; // start from one here, not zero | |
$.get("http://hampus.connormcf.com/leaderboard/get.php?id="+whatone) | |
.done(function( data ) { | |
var scoredata = _(obj).toArray(); | |
console.log(scoredata['score'] + " - " + scoredata['name']); | |
} | |
.failed(function() { | |
alert( "uh oh failed" ); | |
} | |
); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment