toggleCompletedCheck : function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
var key = $(e.currentTarget).attr("id");
this.model = todoCollection.findWhere({
key : key
});
this.model.toggle("completed", true);
this.option.collection = todoCollection.add(this.model);
var email = this.model.get("email");
var title = this.model.get("title");
var key = this.model.get("key");
var status = this.model.get("status");
var completed = this.model.get("completed");
this.updateUserData(email, key, title, completed, status);
returnValue = this.model.save();
console.log(returnValue);
},
準備完了状態はまだ関数内にあります。私が使用した変数はウィンドウオブジェクト(returnValue)です。私はコンソール(クロムブラウザから)でオブジェクトを再び印刷すると、ready状態4を示して、returnValue.responseTextを使ってresponseTextにアクセスすることもできます。 backbone.jsを使用して入力をバックエンドに保存しています。これは、responseTextを保存済みとして返します。しかし、順番に、私はそれをしようとすると私はそれにアクセスすることができませんが未定義と言う。この関数で必要としたresponseTextを取得する方法。準備完了状態はまだ1ですが応答はあります。
ありがとうございました。データはJSONではないためです。私は次のように使いました。 this.model.save([]、{ \tデータ型: "テキスト"、 \t成功:関数(応答){ のreturnValue = response.changed.Saved.xhr.responseText; \t \t \t \t \t にconsole.log (returnValue); \t return returnValue; \t}、 エラー:function(){} }); –