1
我subclassd的Parse.Object象下面這樣:子類具有節電功能
var CFSScoreData = Parse.Object.extend("CFSScoreData",
{
initialize:function() {
this.playerName = "RACCOON";
this.playTimeInSec = 0;
this.rank = 0;
this.updateScore();
},
updateScore:function() {
this.set("playerName", this.playerName);
this.set("playTimeInSec", this.playTimeInSec);
this.set("rank", this.rank);
},
saveScore:function() {
this.updateScore();
this.save(null, {
success: function() {
alert("saveSuccess");
},
error: function(error) {
alert("saveError");
}
});
},
}
);
,這工作得很好。
但我想保存打完獲取對象的ID我想:
saveScore:function() {
this.updateScore();
this.save(null, {
success: function(this) {
alert("saveSuccess" + this.id);
},
error: function(error) {
alert("saveError");
}
});
},
但它沒有工作...
任何建議將讚賞,感謝:)