Parse Hosting& JSSDK查询

时间:2014-07-04 09:14:33

标签: parse-platform

我已经设置了PARSE托管,我正在尝试测试从Parse数据中的类检索对象,但是当我尝试部署时,我收到以下错误:

Update failed with Could not load triggers.  The error was Uncaught You must specify a key using Parse.initialize.

我根据解析文档中的说明设置了我的动态网站。

我的代码

var puppyClass = Parse.Object.extend('PCClass');
var query = new Parse.Query(puppyClass);

var puppies = [];
query.get("7S3NKS1oim", {
  success: function(puppy) {
    // The object was retrieved successfully.
    puppies.push(puppy);
  },
  error: function(object, error) {
    // The object was not retrieved successfully.
    // error is a Parse.Error with an error code and description.
    console.log(error);
  }
});

1 个答案:

答案 0 :(得分:1)

根据错误消息,您必须调用Parse.initialize("ApplicationIdHere", "JavaScriptKeyHere"),并使用您的App ID和JavaScript Key替换这些值。这应该在页面加载时调用一次。