I want to get a variable from the code value:
/* Link Skor */
Memory.prototype.cekSkor = function(){
window.location = "./skor/index.php?value=" + this.numMoves;
}
Memory.prototype._winGame = function() {
var self = this;
if (this.options.onGameEnd() === false) {
this._clearGame();
this.gameMessages.innerHTML =
'<h2 class="mg__onend--heading">Keren!</h2>\
<p class="mg__onend--message">Kamu memenangkan game ini dalam ' + this.numMoves + ' gerakan.</p>\
<button id="mg__onend--restart" class="mg__button">Ingin Bermain Lagi?</button>\
<button id="mg__onend--skor" class="mg__button">Cek Skor?</button>';
this.game.appendChild(this.gameMessages);
document.getElementById("mg__onend--restart").addEventListener( "click", function(e) {
self.resetGame();
});
document.getElementById("mg__onend--skor").addEventListener( "click", function(e) {
self.skor();
});
} else {
// run callback
this.options.onGameEnd();
}
}
I want get the ( this.numMoves ) to another file is index.php
<?php
$skornya = $_GET['value'];
echo $skornya;
?>
when i run the web. i get error The value= not read
What need i do to solve this problem ?
