jquery - Javascript array results returning undefined -


I am working on a simple math game and I am having trouble getting the result of the total answer after the end of the game is .

What is my return function

  function pShowResults () {var pNumResults = document.getElementById ("result"); (Var i = 0; i & lt; = 10; i ++) {pNumStore.push (pNumGuess [i]); Var pNumTable = document.createElement ("div"); PNumTable.innerHTML = (pNumGuess [i]); PNumResults.appendChild (pNumTable); }}   

Too much debugging help is needed. I'm new to this, so I'm guessing that there is a ton which is closed, but until I can get results back, I should be okay

You do not value the x in many codes

  $ (document) .ready (function () {// var pNum1 = []; var pNum2 [[]] var pNumAns = []] var pNumGuess = []; var pNumStore = []] var PNumCarry = 0; var declare arrays and variables for use under pNumTrack = 0; var PNumMessageRight = ['Excellent job!', 'Right!', 'Great work!'] Var pNumMessageWrong = ['Oh no! He was wrong! ',' Wrong! ',' He 'is wrong]; $ atr ("square", "on"); pNumTrack = 0; pNumGen (pNumTrack);}); Click on $ (". PNumSubmit" (".play") (function () {$ ("# popup").) Click (function () {pNumCalc (pNumTrack-1);}); $ (".PNumNext") (function () {pNumGen (pNumTrack);}); function pNumGen (x) {pNum1 [x] = (Math.Round (Math.Random) * 51)); pNum2 [x ] = (Monastery around the monastery (monastery. * 51); pNumAns [x] = pNum1 [x] + pNum2 [x]; $ (".pnum1"). Html (pNum1 [x]); $ ("PNum2"). $ (". PNumGuess") Val (""). $ ("PNum1.") HTML (pNumTrack [x]). (PNumTrack == 2) { $ (". PNumNext") .HTML (". PNumSubmit") HTML ("off"). PShowResults ();} PNumTrack ++;} function pNumCalc (x) {pNumGuess [x] = $ ( ". PNumGuess"). Val (); if (pNumGuess [x] == pNumAns [x]) {$ ("message"). Html (pNumMessageRight [Math.floor (Math.random (* * pNumMessageRight.length) ]; $ (". PNumNext"). Html ("Next Question";)} Other {$ ("Message.") Html (pNumMessageWrong [Math.floor (Math.random (* * pNumMessageWrong.length) ]); $ (". PNumNext") .html ("may be the next question"; "P}}}} function pShowResults () {var pNumResults = for document.getElementById (" result " ); PNumTesults.appendChild (pNumTable);}}};    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -