0
嗯,我已經研究了角度js文檔,並且此代碼在同一臺服務器上完美工作;不知何故,不在跨站點工作;本地主機可到達如何在angular js中使用ajax調用和使用RestFul webservice?
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之後缺少端口? – Vivek
我試過了嗎?謝謝你的迴應 –