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