简体   繁体   English

无法从JavaScript调用云代码

[英]Can't call Cloud Code from JavaScript

I have a JavaScript client which connects to my local Parse server just fine. 我有一个JavaScript客户端,可以很好地连接到我的本地Parse服务器。 Login works, Parse.Query works, however calling any Cloud Code function with Parse.Cloud.run does not work -- instead I get the error 100/XMLHttpRequest failed . 登录作品, Parse.Query的作品,但是调用任何云代码功能Parse.Cloud.run 工作-不是我的错误100/XMLHttpRequest failed Calling CC functions from commandline using curl does work, indicating that the overall server setup is correct. 使用curl从命令行调用CC函数确实可以正常工作,这表明整个服务器设置正确。

It's obviously a client configuration problem on my part, but I just can't figure out what the problem might be. 在我看来,这显然是一个客户端配置问题,但我只是无法弄清楚问题可能是什么。 Client setup is simple enough: 客户端设置非常简单:

Parse.initialize('myappid');
Parse.serverURL = 'http://localhost:1337/parse';

Any ideas? 有任何想法吗?

The problem was that my CC funtion requires a Date argument but I passed in a moment object... now I converted it to Date and all is well again. 问题是我的CC功能需要一个Date参数,但是我传入了一个矩对象...现在我将其转换为Date,一切都很好。 Silly me, but 100/XMLHttpRequest failed/ConnectionFailed is also a very misleading error message for this! 愚蠢的我,但是100 / XMLHttpRequest失败/ ConnectionFailed也是一个非常令人误解的错误消息!

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

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