0
我有更多禮儀的對象。我如何設置本地存儲的其中一個特性?只是適當而不是洞Obj(在java中)。下面是一些我想:將物件設定爲localStorage
function game(){
this.team_one = "team_one";
this.team_two = "team_two";
this.score_home function(val){
return(typeof(val) === 'undefined' ? : localStorage.myVal = val);
};
this.score_away = 0;
}
for(var i=0;i<30;i++){
game_on.push(new game());
}
game_on[0].score_home(7);
alert(game_on[0].score_home);
1)java的! = JavaScript的; 2)你需要檢索你的對象並修改你的屬性...並且更新localStorage – HellBaby 2014-08-30 20:06:43