简体   繁体   English

将Parse的JavaScript框架与Google Apps脚本一起使用

[英]Using Parse's JavaScript framework with Google Apps Script

I would like to use the Parse framework directly in Google Apps Script and copied the following source code from Parse.com directly into my project. 我想直接在Google Apps脚本中使用Parse框架,并将以下源代码直接从Parse.com复制到我的项目中。

However, it seems that there are some adjustments required to get this to work correctly. 但是,似乎需要进行一些调整才能使其正常工作。 eg when running the following sample code... 例如,在运行以下示例代码时...

function upload()
{
  Parse.initialize("wCxiu8kyyyyyyyyyyyyyyyyy", "bTxxxxx8bxxxxxxxxx");
  var TestObject = Parse.Object.extend("TestObjectJSSSSS");
  var testObject = new TestObject();
  testObject.save({foo: "bar"}, {
     success: function(object) {
     alert("yay! it worked");
  }
  });
}

… I get the error message TypeError: Cannot call method "getItem" of undefined . …我收到错误消息TypeError: Cannot call method "getItem" of undefined

which seems to relate to localStorage . 这似乎与localStorage I believe I should replace localStorage with a similar storage type available in Google Apps Script. 我相信我应该用Google Apps脚本中可用的类似存储类型替换localStorage Would that be possible and how would I need to adjust the Parse code? 那有可能吗,我将如何调整解析代码?

What other adjustments would I need to get to the Parse framework to work in my Google Apps Script project? 在Google Apps脚本项目中,要使用Parse框架还需要进行哪些其他调整?

我建议使用Parse REST API将是一个简单得多的解决方案,并且适用于此类情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM