【发布时间】:2016-03-06 08:20:19
【问题描述】:
好吧,我研究了 Angular js 文档,这段代码在同一台服务器上运行完美;不知何故不能在跨站点上工作;本地主机可达
module='user';
siteurl='http://localhost/angularjs';
url=siteurl+"/admin/"+module+"/list";
BlockUi();
$http({
url : url,
method : "post",
data : "",
headers : {'Content-Type':undefined}
}).then(function(responseText){
$scope.totaltablerows=responseText.data.response_data;
$scope.tablerows=$scope.totaltablerows;
UnblockUi();
$scope.searchFunction();
},function(error){
alert(JSON.stringify(error));
UnblockUi();
UnknownError();
});
我应该怎么做才能使它起作用。
【问题讨论】:
-
也许您在 localhost 之后缺少端口?
-
我试过了吗?感谢您的回复
标签: angularjs ajax cross-domain