我想用angularJS的$ http服務,但它似乎並沒有工作。我已經在網上閱讀了關於這個問題,但解決方案並沒有幫助。我在我的控制下:
app.controller('Ctrl', function($scope, $http){
var url = http://someurl?name=foo;
$scope.submitRules = function(){
$http({method: 'GET', url: url}).
success(function(data, status) {
$scope.status = status;
$scope.data = data;
}).
error(function(data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
};
});
每當我嘗試發送它表明請求的狀態是取消請求我使用這個版本的angularJS <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script>
。我發送請求的URL非常好,它只是不能用於angularJS。 有人可以幫忙嗎?
這太模糊不清了......你能舉個例子嗎? –
我想發送一些數據到我的服務器,並希望將它存儲在MySQL數據庫。數據被添加到URL並作爲http獲取請求發送。但是當我用chrome檢查開發者控制檯時。我看到請求沒有通過並被取消。 –
可能有很多原因,不幸的是 –