Click here to Skip to main content
15,907,395 members

Comments by Member 13257242 (Top 31 by date)

Member 13257242 2-Sep-17 10:14am View    
I already have updated my question. No answers.
Member 13257242 1-Sep-17 23:01pm View    
OK! Added some code
Member 13257242 4-Aug-17 10:20am View    
It still doesn't work. I fixed the code a bit and added this into each of the buy functions:

function buymagikarp() {
if(coins >= 100 ) {
swal("Success", "You bought 1 magikarp!", "success");
coins -= 100;
document.getElementById("p1").innerHTML = "Coins: " + coins;
localStorage.setItem('coins', coins);
} else {
swal("Error", "Not enough balance", "error");
}
if(pokemon1 == "") {
pokemon1 += "Magikarp";
localStorage.setItem('Magikarp', pokemon1);
}
if (localStorage.getItem("pokemon1") === null) {
localStorage.getItem('pokemon1');
}
}

I really don't understand why it doesn't work. You probably already understand my skill level of this type of code, but I cannot justify why my code doesn't work. Please help!
Member 13257242 3-Aug-17 14:38pm View    
"won't work" means I still get the same error: here is my website if you want to check it out and see the error pokemonupgrade.000webhostapp.com
Member 13257242 3-Aug-17 14:22pm View    
Even after defining JSONReadyUsers outside of getName2 BOTH in the script tag and in the script.js, It still won't work.