基本上如上所述,我需要我的移动应用程序(使用 Trigger 构建)将 Post 请求发送到远程服务器。具体来说,应用程序生成 GPS 坐标和时间戳,并将数据发送到服务器(使用 Ruby on Rails 构建),服务器获取并存储数据。我正在使用 Zepto 库来发送它。我该如何实现这一目标?
<head> <script type="text/javascript" src="/js/lib/zepto.js"></script></head>
$.post(
url: "http://www.example.com",
data: {
latitude: position.coords.latitude;
longitude: position.coords.longitude;
timestamp: new Date().getTime();},
success: alert("Report Successful");
);
这是实际发送请求的代码。我不相信问题出在其他地方。