我想在授权用户后回写我的谷歌电子表格。授权完成。但是,要回写电子表格,我已发送了here所述的PUT请求。它来自iGoogle Gadget。
我的XML元素是:
var cellUrl = "https://spreadsheets.google.com/feeds/cells/" + key + "/od6/private/full/R2C2";
var XMLData = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gs='http://schemas.google.com/spreadsheets/2006'>" +
"<id>" + cellUrl + "</id><link rel='edit' type='application/atom+xml' href='" + cellUrl + "'/>" +
"<gs:cell row='2' col='2' inputValue='300'/>" +
"</entry>";
我发送AJAX请求为:
$.ajax({
url: cellUrl,
type: "PUT",
contentType: 'application/atom+xml',
processData: false,
data: XMLData,
error: function(XMLHttpRequest, textStatus, errorThrown){
alert(errorThrown);
}, success: function(data, textStatus, XMLHttpRequest){
alert("Succeeded");
}
});
尽管如此,它还没有回写,也没有显示任何警报!什么问题?
我应该使用POST进行回写吗?我该怎么做?
我已隐藏了cellURL密钥以确保安全。它类似于我的电子表格网址中的密钥。
答案 0 :(得分:0)
你能尝试这样的事情来看看是否有错误:
$.ajax({
url: cellUrl,
type: "PUT",
contentType: 'application/atom+xml',
processData: false,
data: XMLData
}, error: function(XMLHttpRequest, textStatus, errorThrown){
alert(errorThrown);
}, success: function(data, textStatus, XMLHttpRequest){
alert("Succeeded");
}
);
答案 1 :(得分:0)
我的建议