5
目前正在設計一個遊戲,這個想法是,一個高分的,所以,當目前的得分比本地存儲一個更多的則是替代:設置在本地存儲變量
localStorage.setItem('highScore', highScore);
var HighScore = localStorage.getItem('highScore');
if (HighScore == null || HighScore == "null") {
HighScore = 0;
}
if (user.points > HighScore) {
highScore = parseInt(HighScore);
}
return highScore
謝謝你們
你的問題是什麼? – nullability 2013-04-26 21:32:21
如何修復它,因爲它不工作? – 2013-04-26 21:41:44
定義不起作用 – 2013-04-26 21:43:30