Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thank you for all your suggestions! This was my first question ever, I will look at all of them and see if I can get it working. </p> <p>This is where I am calling postPHP:</p> <pre><code> function checkScore(score, record) { alert('Score= ' + score); alert ('Record= '+ record); if(score &lt; record || record === 0){ alert ("NEW RECORD"); //this alert is displayed when needed postPHP(score); } }; </code></pre> <p>and checkScore was called when the user moved a target crate back to the beginning spot and the following statement was executed</p> <pre><code> if (this.hasWon()) { var finalScore = this.getScore(); var record = this.getRecord(); checkScore(finalScore, record); return ret; //moving not allowed } </code></pre> <p>there are some access methods used there.</p> <pre><code> //access methods Board.prototype.hasWon = function() { return state === 1; }; Board.prototype.getScore = function() { return score; }; Board.prototype.getWt = function(r, c) { return b[r][c]; }; Board.prototype.getData = function() { return {"bobR": bobR, "bobC": bobC, "bobDir": bobDir, "tgtR": tgtR, "tgtC": tgtC, "startC": startC, "n": n}; }; Board.prototype.getRecord = function(){ var s = "" + window.location; var ampIdx = "" + s.indexOf("&amp;"); ampIdx = parseInt(ampIdx); ampIdx = ampIdx + 7; var record = "" + s.substring(ampIdx); //alert("Puzzle Record= " + record); record = parseInt(record); return record; } ; </code></pre> <p>I do have the javascript included. I do call it once in the body of the HTML, for some reason it doesn't display the game correctly when included in the head.</p> <p>Again, thank you for the help! I will let you know what I get to work!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload