プログラムでスプレッドシートに書き込む必要があります。スプレッドシートの特定のセルに書き込むことができます。私のコードは次のとおりです。
function update(){
jQuery.ajax({
type: 'PUT',
contentType: "application/atom+xml",
url: "https://spreadsheets.google.com/feeds/cells/0Aq69FHX3TV4ndDBDVFFETUFhamc5S25rdkNoRkd4WXc/od6/private/full/R2C1",
dataType: "xml",
data: "new.xml",
success: function() {
alert('Put Success');
},
error: function(a,b,c) {
console.log("XMLHttpRequest: " + a);
console.log("textStatus: " + b);
console.log("errorThrown: " + c);
alert("XMLHttpRequest : " + a + " textStatus : " + b + " errorThrown : " + c);
}
});
}
xml 要素のみを使用してスプレッドシートに書き込むことができます。だから、私は(new.xml)を作成しました:
<entry>
<id>https://spreadsheets.google.com/feeds/cells/0Aq69FHX3TV4ndDBDVFFETUFhamc5S25rdkNoRkd4WXc/od6/private/full/R2C1</id>
<link rel="edit" type="application/atom+xml"
href="https://spreadsheets.google.com/feeds/cells/0Aq69FHX3TV4ndDBDVFFETUFhamc5S25rdkNoRkd4WXc/worksheetId/private/full/R2C1"/>
<gs:cell row="2" col="1" inputValue="300"/>
</entry>
しかし、私のコードはまだエラーをスローしています。私が書いているXMLファイルに関連していると思います。new.xml の作成は私のエラーだと思います。書き戻す方法を教えてください。xml 要素を作成するにはどうすればよいですか?
参考:セルの更新
出力 : a : [オブジェクト オブジェクト]
b : 未定義
c :