【发布时间】:2018-02-20 09:21:09
【问题描述】:
我想从代码值中得到一个变量:
/* 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();
}
}
我想把 (this.numMoves) 拿到另一个文件是 index.php
<?php
$skornya = $_GET['value'];
echo $skornya;
?>
当我运行网络时。我得到错误 该值=未读取
我需要做什么来解决这个问题?
【问题讨论】:
标签: javascript php html web