是否可以将类添加到解析云代码中
Is it possible to add classes to Parse Cloud Code?
我想将这些类添加到我的解析云代码中:
function Rule = {
this.accessor = new Accessor();
this.act = new Action();
}
Rule.prototype.sendEmail = function(email, threshold, bill){
if (this.accessor.check(threshold, bill)){
this.act.actionTake(email, threshold, bill);
}
};
function Accessor = {
}
Accessor.prototype.check = function(threshold, bill){
return bill > threshold;
};
function Action = {
}
Action.prototype.actionTake = function(email, threshold, bill){
//send email code
};
但是当我确实将其添加到javascript文件的最顶部时
我得到Update failed with Could not load triggers. The error was Uncaught SyntaxErrorL Unexpected token in main.js:1
解析云代码只是为了定义后台作业和云函数吗?是否可以将"类"定义添加到解析云代码中?
谢谢
var Rule = function() {
this.accessor = new Accessor();
this.act = new Action();
};
或
function Rule() {
this.accessor = new Accessor();
this.act = new Action();
}
基本的JS语法,与解析无关
相关文章:
- 将 jQuery 代码添加到 Index.aspx 页面
- Javascript代码添加了一些不应该存在的内容
- 将Google AdWords转换跟踪(javascript)代码添加到PrestaShop/Smarty页面中
- 向以下代码添加不接受“0”的另一个条件
- 如何为该代码添加回调函数
- 将javascript代码添加到URL
- jquery将HTML代码添加到页面中
- jQuery/can'我找不到避免代码添加类的方法
- 如何将我自己的验证代码添加到MooTools的lightface表单中
- 需要帮助将一些JavaScript代码添加到我的wordpress主题中
- 将 JQuery 或 Javascript(不是 coffee.script)代码添加到 Rails 3.2 应用程序中
- JQuery 悬停代码:添加 If 语句会破坏它
- 如何在jsp中单击按钮时将代码添加到jqPlot条形图另存为图像
- JavaScript 将代码添加到已经设置的事件中
- 仅将 Javascript 代码添加到最后一个文本区域
- 如何使用此示例使用 javascript 将代码添加到我的表单标签中
- 将 Jquery 无冲突代码添加到我当前的代码中
- 如何将自定义代码添加到prestashop
- 调试JavaScript和css代码:添加一个事件处理程序
- Dojo 使用 domConstruct 将声明性代码添加到现有手风琴中