【发布时间】:2012-02-07 09:12:33
【问题描述】:
我尝试从一个 iphone 应用程序连接到一个简单的 json 网络服务 - 由 phonegap 制作(直接来自 iPhone 模拟器),但我无法做到。
Webserver 很简单,接收 2 个参数并将相同的参数返回给应用程序 - 仅用于测试(位于另一台服务器)。 客户:
//here we make the call to the webservice
var TheURL = "http://www.wsurl.com/json_ws/json_webserver.php?";
TheURL += 'latitude=' + latitude + '&';
TheURL += 'longitude=' + longitude + '&';
TheURL += 'jsoncallback=?';
if(checkConnection()){
$.getJSON(TheURL,function(msg){alert(msg); });
}
你有什么想法应该是错的吗?
谢谢!
【问题讨论】: