1
我有一个JavaScript方法摘录如下访问REST服务的另一台服务器
var tempUrl = "http://A.com:8081/TestService/serviceMethod";
jQuery.ajax({
url:tempUrl,
type: 'POST',
data:"getDatareq="+encodedata,
contentType: 'application/json',
dataType:'text',
success:function(result){
jQuery(".loadingMsg").html("");
jQuery(".loadingMsg").hide();
getApptDtls(result);
},
complete:function(result){
jQuery(".loadingMsg").html("");
jQuery(".loadingMsg").hide();
jQuery(".popupContent").show();
jQuery.unblockUI();
我包括在HTML了这种方法,当我运行这个网站网址为http://B.com:8081
在另一个服务器托管并调用此方法,A.com中的serviceMethod没有被击中。这里可能是什么问题?
任何帮助,非常感谢。
将JSONP的岗位工作。我已经尝试与POST相同。但它不工作。我应该使用jSon回拨吗? – NishM 2013-04-12 17:54:22
对不起后期更新。 jSonP工作。 – NishM 2015-01-27 19:41:51