How do I call a cloud code function with parameters using the Javascript SDK

user379468

I know in the iOS sdk I can do it like this

[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);
    }
}];

but how would I do this with a Javascript function

danh

Parse.Cloud implements 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
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I call a function with parameters?

How do I find out when a twilio call has actually been answered when using the JavaScript SDK?

How do I call other Google APIs from a Cloud Function?

How do I call a JavaScript function from Asp.Net Code Behind?

How do i rewriting a function code javascript

How do I call Java code from JavaScript code in Wicket?

How do I return javascript data from a function using a recursive call

How do I force gcc to call a function directly in PIC code?

How do I call some part of code again in same function?

How do I call the function of sending a email in this code in corona?

How do I create a function/method out of this code and then call it to the main()?

How to call ascx function code behind using javascript? DotNetNuke

How do I apply a function with multiple parameters using `cellfun` (MATLAB)?

How do I run a function over and over by using parameters?

Spring Cloud Function - how to pass multiple parameters to a function call in Kotlin

How do I trigger/call Cloud Build from a Python Cloud Function

How do I call a Javascript function from my Android activity?

How do I call a static Typescript class function from javascript?

How do I call a Javascript function from Python?

How do I call a JavaScript function that uses jQuery?

How do I call a Vue method into a plain javascript function?

How do I call a JavaScript function on page load?

How do I call a python function from a cgi script with javascript?

How do I call a nested JavaScript function properly

How do I call a function within the same class in JavaScript?

In karate DSL how do i call javascript function in the 'Then' statement

How do I call a JavaScript function inside PHP?

How do i call angularjs function from javascript?

How do i call a function first and then the second in javascript