0
Why doesnt it work
i thought i did it good, can someone please explain why and what doesnt work, and how to correct the mistake. https://code.sololearn.com/WuU3yGBHAGLO/?ref=app
14 Respuestas
+ 1
You are selecting the element before it is ready. Put the var "pts =" in the onload but keep the "var pts" outside so that it gets created in the window scope.
+ 1
hi,
@roel
-----------------
i have refreshed your code
try this url :-
-----------------------------
https://code.sololearn.com/WCdw9Y41n6FR
0
Thanks, it works now
0
Rajeeb thanks, but i already corrected my mistake:
https://code.sololearn.com/WuU3yGBHAGLO/?ref=app
0
Nommer101 did the exact same thing with var upmpc, but it seem to give the error (upmpc is not defined)
0
Roel $(function(){ is the same as onLoad but its running before onload is running.
0
try my code @roel
from rajeeb
0
Roel Its actually your code is getting declared in a scope so the variable dies after onload executes.
Put var upmpc with other variables.
0
Rajeeb I'll see what parts can make my code better, and what parts i want to keep because my brain says it
0
Roel innerHTML is not a jquery property. Use text (""), val ("") or html ("")
0
Nommer101 then why does it work with wallet?🤔🤔
0
Roel Probably because you selected by ID or you have a newer version of jquery. Or I'm just wrong 😅
0
nah, ill just use the good old trusted way: document.getElementById("").innerHTML.
might be longer, but it works