我知道在iOS sdk中我可以这样做
[PFCloud callFunctionInBackground:@"email" withParameters:@{@"param1": @"quantity1,@"param2": @"quantity2} block:^(NSString *result,NSError *error) { if (error) { //error } else { // make sure the set the email sent flag on the object NSLog(@"result :%@",result); } }];
但是如何使用Javascript函数执行此操作
解决方法
Parse.Cloud实现了run()……
Parse.Cloud.run("email",{ param1:"quantity1",param2:"quantity2" }).then(function(result) { // make sure the set the email sent flag on the object console.log("result :" + JSON.stringify(result)) },function(error) { // error });