我正在尝试创建一个示例页面,我可以在其中填写某些表单,然后将数据保存到Parse API。我首先尝试使用字符串,如下所示:
var Billing = Parse.Object.extend("Billing");
var billing = new Billing();
billing.set("First Name", "John");
billing.set("Last Name", "Doe");
billing.set("Email", "admin@parse.com");
这确实很好,但是当我刚写了一个变量时,我收到错误“POST 400 Bad Request”:
var Billing = Parse.Object.extend("Billing");
var billing = new Billing();
billing.set("First Name", frnm);
billing.set("Last Name", lsnm);
billing.set("Email", eml);
为什么?我似乎找不到另一种方法让它工作...... 请在此处查看我的完整编码要点here
答案 0 :(得分:0)
我用过:
document.getElementById("card_cvNumber").value;
而不是:
$('#card_cvNumber').val();
和Parse JS:
var Billing = Parse.Object.extend("Billing");
var billing = new Billing();
billing.save({Firstname: frnm, Lastname: lsnm, Company: cpnm, Adress: str1, City: cty, State: stat, PostalCode: zpc, Country: ctry, Phone: phn, Fax: fx, Email: eml}, {
success: function(object) {
alert("Success");
}
});
效果很好!