lundi 11 septembre 2017

How to get variable from javascript to php?

I want get a varialbe from the code value=

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 enter image description here

What need i do to solve this problem ?




Aucun commentaire:

Enregistrer un commentaire